Documentation ¶
Index ¶
- Variables
- func Atof32exact(mantissa uint64, exp int, neg bool) (f float32, ok bool)
- func Atof64exact(mantissa uint64, exp int, neg bool) (f float64, ok bool)
- func EiselLemire32(man uint64, exp10 int, neg bool) (f float32, ok bool)
- func EiselLemire64(man uint64, exp10 int, neg bool) (f float64, ok bool)
- type Decimal
Constants ¶
This section is empty.
Variables ¶
View Source
var Float32info = floatInfo{23, 8, -127}
View Source
var Float64info = floatInfo{52, 11, -1023}
Functions ¶
func Atof32exact ¶
If possible to compute mantissa*10^exp to 32-bit float f exactly, entirely in floating-point math, do so, avoiding the machinery above.
func Atof64exact ¶
If possible to convert decimal representation to 64-bit float f exactly, entirely in floating-point math, do so, avoiding the expense of decimalToFloatBits. Three common cases:
value is exact integer value is exact integer * exact power of ten value is exact integer / exact power of ten
These all produce potentially inexact but correctly rounded answers.
Types ¶
type Decimal ¶
type Decimal struct {
// contains filtered or unexported fields
}
func (*Decimal) RoundedInteger ¶
Extract integer part, rounded appropriately. No guarantees about overflow.
Click to show internal directories.
Click to hide internal directories.