Maybe you answer is different from mine because you are running Perl in another architecture. Are you using a Intel based machine?
I've already said it's the underlying C library that makes the difference for cos().
And how can I decide, up to what point I can trust Perl calculations?
It's my understanding that libraries often approximate the result of trig functions. In Perl's case, it uses the underlying C library. I don't know what kind of precision guarantees (if any) C makes concerning its trig functions. Feel free to look it up.
And when Perl is returning numbers in this fashion can I be sure that if I use bigger numbers, the error wont grow to make more wrong digits?
I don't understand the question. You single out the previously discussed manner or returning numbers, but no ways of returning numbers were previously discussed. What does Perl returning numbers even mean? What are the other manners in which Perl returns numbers to which you allude?
Is there a way that I restrict Perl return values to what is safe for big number without truncating all return numbers from native Perl functions by myself?
The premise makes no sense. Truncating and rounding reduce precision.
Actual: -0.3633850893556905538... Java's error: 0.0000000000000000538... Your C's error: 0.0000000000001194462... Rounded error: 0.0000000000003094462... Truncated error: 0.0000000000006905538...
Besides that, the precision of the result of each operation depends on the precision of the result of each operand of that operation. Neither Perl nor the computer know the precision of the operands, so it can't know the precision of the output.
In reply to Re^3: cos (100000000.0)
by ikegami
in thread cos (100000000.0)
by kavehmz
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |