November 2017
Beginner
316 pages
6h 40m
English
We regularly come across simple operations on floating point numbers in various programming languages not giving the expected value.
One common example is:
julia> x = 1.1; y = 0.1; x+y1.2000000000000002
This happens when that particular number doesn’t have the expected floating point representation.
We can use the setrounding() function provided by Julia to handle this:
julia> setrounding(Float64,RoundDown) dox + yend1.2
Read now
Unlock full access