-
-
Notifications
You must be signed in to change notification settings - Fork 5.7k
Closed
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorsystem:32-bitAffects only 32-bit systemsAffects only 32-bit systems
Description
This was seen on a 32-bit Xeon system:
julia> ndigf(n)=float64(log(float32(n)))
julia> ndigf(256)
5.5451774444736657
julia> float64(log(float32(256)))
5.5451774597167969
julia> log(256)
5.5451774444795623
The last answer is correct, the middle one is the float64 conversion of the correctly-rounded float32 answer, and the first one is something strange.
julia> num2hex(5.5451774444795623)
"40162e42fefa39ef"
julia> num2hex(5.5451774444736657)
"40162e42fefa2000"
Looks like the float64 answer with the last 13 bits zero'd.
Happens with some functions, e.g. log and sin, but not with sqrt.
Metadata
Metadata
Assignees
Labels
bugIndicates an unexpected problem or unintended behaviorIndicates an unexpected problem or unintended behaviorsystem:32-bitAffects only 32-bit systemsAffects only 32-bit systems