I have been running C++ floating point tests using the Twilight Dragon Media C++ compiler for 64 bit Windows 10.
https://jmeubank.github.io/tdm-gcc/
C++ starts by using IEEE 754 equation for floats and doubles, decimal and hexadecimal values, floating point arithmetic, if I have things right. See this at:
https://introcs.cs.princeton.edu/java/91float/
I have learned that when you compile in
what you get is stored is
0.100000001490116119384765625
whereas when you compile in
what you get stored is
0.1000000000000000055511151231257827021181583404541015625
Most of your floating point operators are these:
+, -, *, /, %, ++n, --n, n++, n--, +=, -=, *=, /=, %=
Is there a GNU C++ switch that will turn off all of these floating point overflow and underflow values, both for assignment of the floating point data and arithmetic operator calculation for separate floating point data, too? How can this be acheived without adjusting the floating point source code at all?
https://jmeubank.github.io/tdm-gcc/
C++ starts by using IEEE 754 equation for floats and doubles, decimal and hexadecimal values, floating point arithmetic, if I have things right. See this at:
https://introcs.cs.princeton.edu/java/91float/
I have learned that when you compile in
Code:
A)
float a = 0.1F;
what you get is stored is
0.100000001490116119384765625
whereas when you compile in
Code:
B)
double b = 0.1D;
what you get stored is
0.1000000000000000055511151231257827021181583404541015625
Most of your floating point operators are these:
+, -, *, /, %, ++n, --n, n++, n--, +=, -=, *=, /=, %=
Is there a GNU C++ switch that will turn off all of these floating point overflow and underflow values, both for assignment of the floating point data and arithmetic operator calculation for separate floating point data, too? How can this be acheived without adjusting the floating point source code at all?
Last edited: