I am a bit confused about the floating value addition in Julia. When I try to add two float values in Julia am getting a non rounded value with more precision.
julia> 106.8 + 1.085
107.88499999999999
I want to know if there is a way I can round the result as follows.
julia> 106.8 + 1.085
107.885
I have tested the round(value, digit=N) method to get the above result.
Why is the result not rounded by default and Is there any other way to get the rounded result besides round() function.
You can control the number of digits printed in the REPL, e.g., without loosing precision like this (it will affect printing of all subsequent floats):