MCPcopy
hub / github.com/shopspring/decimal / Float64

Method Float64

decimal.go:1449–1451  ·  view source on GitHub ↗

Float64 returns the nearest float64 value for d and a bool indicating whether f represents d exactly. For more details, see the documentation for big.Rat.Float64

()

Source from the content-addressed store, hash-verified

1447// whether f represents d exactly.
1448// For more details, see the documentation for big.Rat.Float64
1449func (d Decimal) Float64() (f float64, exact bool) {
1450 return d.Rat().Float64()
1451}
1452
1453// InexactFloat64 returns the nearest float64 value for d.
1454// It doesn't indicate if the returned value represents d exactly.

Callers 5

InexactFloat64Method · 0.95
TestNewFromFloatRandomFunction · 0.80
TestNewFromFloat32RandomFunction · 0.80
TestFloat64Function · 0.80

Calls 1

RatMethod · 0.95

Tested by 4

TestNewFromFloatRandomFunction · 0.64
TestNewFromFloat32RandomFunction · 0.64
TestFloat64Function · 0.64