Open Petrarca181 opened 1 month ago
I wonder if the actual value stored for 3.12 is far enough away from 3.12 that Xaml doesn't round it correctly. Well, floating point numbers are hard.
The actual value stored for 3.12 is:
float: 3.11999988555908203125
double: 3.12000000000000010658141036401502788066864013671875
These are the C/C++ types, but float is single precision (32 bit) and double is double precision (64 bit).
I wonder if the actual value stored for 3.12 is far enough away from 3.12 that Xaml doesn't round it correctly. Well, floating point numbers are hard.
The actual value stored for 3.12 is: float:
3.11999988555908203125
double:3.12000000000000010658141036401502788066864013671875
These are the C/C++ types, but float is single precision (32 bit) and double is double precision (64 bit).
NuberBox Value propertry is double. I can bind it to the ViewModel or asign value code behind, with same result.
Then it is internally getting converted to float.
Just to clarify something important. There is a disagreement between the value in the original report. There is an image that states 3.1199999.... but the title states 3.199999..... The image contains a value that would be understandable for a double->float conversion. The value in the title is completely unexpected. So I am making an assumption that the value in the title is a typo where the value in the image is the correct value.
You could try to use decimal, but then you are even more effed, because you can not bind to decimal and need a converter.
Describe the bug
As in title, any other number is ok only 3.12 is 3.199999999999...
Steps to reproduce the bug
Expected behavior
No response
Screenshots
No response
NuGet package version
None
Windows version
No response
Additional context
No response