wizard699 Active Member Licensed User Longtime User Jul 19, 2015 #1 Erel why Dim tot as Double tot = 10.30 + 5.80 + 5.80 At the end ... tot is not equal to 21.90 but to 21.900000002 ???? Why????
Erel why Dim tot as Double tot = 10.30 + 5.80 + 5.80 At the end ... tot is not equal to 21.90 but to 21.900000002 ???? Why????
Erel B4X founder Staff member Licensed User Longtime User Jul 19, 2015 #2 Binary floating point numbers cannot accurately represent decimal numbers. You can read more about the format here: https://en.wikipedia.org/wiki/Double-precision_floating-point_format Use NumberFormat or NumberFormat2 when you show the number and everything will work as expected. Upvote 0
Binary floating point numbers cannot accurately represent decimal numbers. You can read more about the format here: https://en.wikipedia.org/wiki/Double-precision_floating-point_format Use NumberFormat or NumberFormat2 when you show the number and everything will work as expected.
wizard699 Active Member Licensed User Longtime User Jul 19, 2015 #3 Thnks a lot Erel and good Sunday Upvote 0