Hello, first post here from me!
I am a beginner in real programming, had some visual scripting experience as a hobby. I have a general question about floating point representation.
I tested some things and found that a maximum number of digits in a fractional part of a float number is 9 when dealing with long fractional numbers, meaning there is a cutoff from 9th digit after the floating point, so the rounding error is significant.
If, for example, I use reciprocal function 1/x, precision is lost: 1/119 returns 0.008403362, but 1/0.008403362 returns 118.99999. In 32 bit standard, there should be more digits, as stated here:
“The smallest normal value of a float, known as FLT_MIN, is 2-126. A significand of 24 1s starting at the place of the smallest normal power of two exponent (-126) is this 24 significant bit number:
1.11111111111111111111111 x 2-126
Written out longhand in binary it is 149 bits, 125 leading zeros followed by 24 1s. In decimal it is
It has 149 digits, 37 leading zeros followed by 112 significant digits."
My questions are: How to get full expression of a float number as described above and use it in functions? Is there a limitation or restriction on long float numbers in processing? And, if there are restrictions, is it possible to work around them?
I searched for answers in processing forums and documentation without much results. So, I would very much appreciate if someone has more insight into this matter.
Thank you in advance.