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 v4-17-test 1498b464 Lines: 0 7 0.0 %
Date: 2024-06-13 04:01:37 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             :    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.13