PostgreSQL Source Code git master
|
#include "postgres.h"
#include "common/shortest_dec.h"
#include "digit_table.h"
#include "ryu_common.h"
Go to the source code of this file.
Data Structures | |
struct | floating_decimal_32 |
Macros | |
#define | FLOAT_MANTISSA_BITS 23 |
#define | FLOAT_EXPONENT_BITS 8 |
#define | FLOAT_BIAS 127 |
#define | FLOAT_POW5_INV_BITCOUNT 59 |
#define | FLOAT_POW5_BITCOUNT 61 |
Typedefs | |
typedef struct floating_decimal_32 | floating_decimal_32 |
Functions | |
static uint32 | pow5Factor (uint32 value) |
static bool | multipleOfPowerOf5 (const uint32 value, const uint32 p) |
static bool | multipleOfPowerOf2 (const uint32 value, const uint32 p) |
static uint32 | mulShift (const uint32 m, const uint64 factor, const int32 shift) |
static uint32 | mulPow5InvDivPow2 (const uint32 m, const uint32 q, const int32 j) |
static uint32 | mulPow5divPow2 (const uint32 m, const uint32 i, const int32 j) |
static uint32 | decimalLength (const uint32 v) |
static floating_decimal_32 | f2d (const uint32 ieeeMantissa, const uint32 ieeeExponent) |
static int | to_chars_f (const floating_decimal_32 v, const uint32 olength, char *const result) |
static int | to_chars (const floating_decimal_32 v, const bool sign, char *const result) |
static bool | f2d_small_int (const uint32 ieeeMantissa, const uint32 ieeeExponent, floating_decimal_32 *v) |
int | float_to_shortest_decimal_bufn (float f, char *result) |
int | float_to_shortest_decimal_buf (float f, char *result) |
char * | float_to_shortest_decimal (float f) |
Variables | |
static const uint64 | FLOAT_POW5_INV_SPLIT [31] |
static const uint64 | FLOAT_POW5_SPLIT [47] |
typedef struct floating_decimal_32 floating_decimal_32 |
Definition at line 174 of file f2s.c.
References Assert.
Referenced by to_chars().
|
inlinestatic |
Definition at line 222 of file f2s.c.
References fd(), FLOAT_BIAS, FLOAT_MANTISSA_BITS, FLOAT_POW5_BITCOUNT, FLOAT_POW5_INV_BITCOUNT, i, j, log10Pow2(), log10Pow5(), mulPow5divPow2(), mulPow5InvDivPow2(), multipleOfPowerOf2(), multipleOfPowerOf5(), output, and pow5bits().
Referenced by float_to_shortest_decimal_bufn().
|
inlinestatic |
Definition at line 689 of file f2s.c.
References floating_decimal_32::exponent, FLOAT_BIAS, FLOAT_MANTISSA_BITS, and floating_decimal_32::mantissa.
Referenced by float_to_shortest_decimal_bufn().
char * float_to_shortest_decimal | ( | float | f | ) |
Definition at line 797 of file f2s.c.
References FLOAT_SHORTEST_DECIMAL_LEN, float_to_shortest_decimal_buf(), and palloc().
int float_to_shortest_decimal_buf | ( | float | f, |
char * | result | ||
) |
Definition at line 780 of file f2s.c.
References Assert, FLOAT_SHORTEST_DECIMAL_LEN, and float_to_shortest_decimal_bufn().
Referenced by float4out(), and float_to_shortest_decimal().
int float_to_shortest_decimal_bufn | ( | float | f, |
char * | result | ||
) |
Definition at line 742 of file f2s.c.
References copy_special_str(), f2d(), f2d_small_int(), FLOAT_EXPONENT_BITS, FLOAT_MANTISSA_BITS, float_to_bits(), and to_chars().
Referenced by float_to_shortest_decimal_buf().
Definition at line 168 of file f2s.c.
References FLOAT_POW5_SPLIT, i, j, and mulShift().
Referenced by f2d().
Definition at line 162 of file f2s.c.
References FLOAT_POW5_INV_SPLIT, j, and mulShift().
Referenced by f2d().
Definition at line 120 of file f2s.c.
References Assert, and PG_UINT32_MAX.
Referenced by mulPow5divPow2(), and mulPow5InvDivPow2().
Definition at line 102 of file f2s.c.
References pow5Factor(), and value.
Referenced by f2d().
Definition at line 81 of file f2s.c.
Referenced by multipleOfPowerOf5().
|
inlinestatic |
Definition at line 563 of file f2s.c.
References decimalLength(), DIGIT_TABLE, floating_decimal_32::exponent, i, floating_decimal_32::mantissa, output, sign, and to_chars_f().
Referenced by float_to_shortest_decimal_bufn().
|
inlinestatic |
Definition at line 440 of file f2s.c.
References Assert, DIGIT_TABLE, floating_decimal_32::exponent, i, floating_decimal_32::mantissa, and output.
Referenced by to_chars().
|
static |
Definition at line 54 of file f2s.c.
Referenced by mulPow5InvDivPow2().
|
static |
Definition at line 65 of file f2s.c.
Referenced by mulPow5divPow2().