LCOV - code coverage report
Current view: top level - third_party/heimdal/lib/hcrypto/libtommath - bn_mp_get_double.c (source / functions) Hit Total Coverage
Test: coverage report for master 2f515e9b Lines: 0 8 0.0 %
Date: 2024-04-21 15:09:00 Functions: 0 1 0.0 %

          Line data    Source code
       1             : #include "tommath_private.h"
       2             : #ifdef BN_MP_GET_DOUBLE_C
       3             : /* LibTomMath, multiple-precision integer library -- Tom St Denis */
       4             : /* SPDX-License-Identifier: Unlicense */
       5             : 
       6           0 : double mp_get_double(const mp_int *a)
       7             : {
       8           0 :    int i;
       9           0 :    double d = 0.0, fac = 1.0;
      10           0 :    for (i = 0; i < MP_DIGIT_BIT; ++i) {
      11           0 :       fac *= 2.0;
      12             :    }
      13           0 :    for (i = a->used; i --> 0;) {
      14           0 :       d = (d * fac) + (double)a->dp[i];
      15             :    }
      16           0 :    return (a->sign == MP_NEG) ? -d : d;
      17             : }
      18             : #endif

Generated by: LCOV version 1.14