Source File
ldexp.go
Belonging Package
math
package math
switch {
case == 0:
return // correctly return -0
case IsInf(, 0) || IsNaN():
return
}
, := normalize()
+=
:= Float64bits()
+= int(>>shift)&mask - bias
if < -1075 {
return Copysign(0, ) // underflow
}
if > 1023 { // overflow
if < 0 {
return Inf(-1)
}
return Inf(1)
}
var float64 = 1
if < -1022 { // denormal
+= 53
= 1.0 / (1 << 53) // 2**-53
}
&^= mask << shift
|= uint64(+bias) << shift
return * Float64frombits()
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |