Skip to content
This repository was archived by the owner on Nov 24, 2018. It is now read-only.
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions native/general.go
Original file line number Diff line number Diff line change
Expand Up @@ -92,16 +92,15 @@ func max(a, b int) int {

var (
// dlamchE is the machine epsilon. For IEEE this is 2^-53.
dlamchE = math.Float64frombits(0x3ca0000000000000)
dlamchE = 1.0 / (1 << 53)

// dlamchP is 2 * eps
dlamchP = math.Float64frombits(0x3cb0000000000000)
dlamchP = 2 * dlamchE

// dlamchS is the "safe min", that is, the lowest number such that 1/sfmin does
// not overflow. The Netlib code for calculating this number is not correct --
// it overflows.
// Found from printing out from FORTRAN
dlamchS = 2.2250738585072014E-308
// it overflows. Found by comparison with the FORTRAN value.
dlamchS = math.Nextafter((4 / math.MaxFloat64), 0)

smlnum = dlamchS / dlamchP
bignum = 1 / smlnum
Expand Down