Audacity 3.2.0
Static Public Attributes | List of all members
fast_float::powers_template< unused > Struct Template Reference

#include <fast_float.h>

Static Public Attributes

static constexpr int smallest_power_of_five = binary_format<double>::smallest_power_of_ten()
 
static constexpr int largest_power_of_five = binary_format<double>::largest_power_of_ten()
 
static constexpr int number_of_entries = 2 * (largest_power_of_five - smallest_power_of_five + 1)
 
static const uint64_t power_of_five_128 [number_of_entries]
 

Detailed Description

template<class unused = void>
struct fast_float::powers_template< unused >

When mapping numbers from decimal to binary, we go from w * 10^q to m * 2^p but we have 10^q = 5^q * 2^q, so effectively we are trying to match w * 2^q * 5^q to m * 2^p. Thus the powers of two are not a concern since they can be represented exactly using the binary notation, only the powers of five affect the binary significand. The smallest non-zero float (binary64) is 2^−1074. We take as input numbers of the form w x 10^q where w < 2^64. We have that w * 10^-343 < 2^(64-344) 5^-343 < 2^-1076. However, we have that (2^64-1) * 10^-342 = (2^64-1) * 2^-342 * 5^-342 > 2^−1074. Thus it is possible for a number of the form w * 10^-342 where w is a 64-bit value to be a non-zero floating-point number.

Any number of form w * 10^309 where w>= 1 is going to be infinite in binary64 so we never need to worry about powers of 5 greater than 308.

Definition at line 730 of file fast_float.h.

Member Data Documentation

◆ largest_power_of_five

template<class unused = void>
constexpr int fast_float::powers_template< unused >::largest_power_of_five = binary_format<double>::largest_power_of_ten()
staticconstexpr

Definition at line 733 of file fast_float.h.

◆ number_of_entries

template<class unused = void>
constexpr int fast_float::powers_template< unused >::number_of_entries = 2 * (largest_power_of_five - smallest_power_of_five + 1)
staticconstexpr

Definition at line 734 of file fast_float.h.

◆ power_of_five_128

template<class unused >
const uint64_t fast_float::powers_template< unused >::power_of_five_128
static

Definition at line 736 of file fast_float.h.

Referenced by fast_float::compute_product_approximation().

◆ smallest_power_of_five

template<class unused = void>
constexpr int fast_float::powers_template< unused >::smallest_power_of_five = binary_format<double>::smallest_power_of_ten()
staticconstexpr

Definition at line 732 of file fast_float.h.

Referenced by fast_float::compute_product_approximation().


The documentation for this struct was generated from the following file: