'Sum of two float64 variables in go [duplicate]
Could somebody explain me next rows:
var a, b = 2.0000001, 3.00000
fmt.Println(a + b)
fmt.Println(2.0000001 + 3.00000)
results of prints:
first print: 5.000000099999999
second print: 5.0000001
Why result of first print as above?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
Solution | Source |
---|