Pelles C > Bug reports

Factorial Bug

<< < (3/3)

frankie:

--- Quote from: Pelle on June 07, 2020, 07:31:02 PM ---There are apparently a few modern/popular methods of doing this kind conversion, with possibly slightly better results, but also (AFAICT) involving more code. Nobody wants a big bloated C runtime, so I think "good enough" in this case is good enough.

--- End quote ---
Right decision, the issue, if it could really be defined a problem, arise when the magnitude becomes very large (or very small), in a field that should be of interest only to very specific applications that are supposed to use better tools for calculations (i.e. bignum libraries).
I haven't investigated much, I should confess (actually the work takes a lot of energy to recover delays due to COVID-19), but the point seem to be the use of floating variables through the conversion process, which introduce the rounding errors at some point when the converted value exceeds the mantissa capacity, propagating the rounding through the flow. The trick should be to mask resolution when the magnitude of the value becomes large enough (i.e. when reached the max significant digit number for the mantissa just output 0's  :o ).
Waiting for release...  ;)

Akko:
Then there is always the fused multiply-add operator fma() with higher internal precision. So:

c = a * b;  <==>  c = fma (a, b, 0.);

I hope that Pelle's upcoming C version will support __int128_t and fp quad math.

Navigation

[0] Message Index

[*] Previous page

Go to full version