Wouldn't e have to be pure also? | [reply] [Watch: Dir/Any] |
Wouldn't e have to be pure also?
You're correct - the inexactness of "e" is also influencing the result.
UPDATE: BTW, in perl we can reproduce you're original result with:
>perl -MMath::Complex -le "print exp(1) ** (pi * i);"
-1+1.22460635382238e-16i
Oops ... hang on ... that's not exactly the same. (I'm not all that familiar with Raku, so I'm not sure what accounts for that difference.)
Cheers, Rob | [reply] [Watch: Dir/Any] [d/l] |
-1+1.22464679914735e-16i
Using perl -v, my perl is " This is perl 5, version 32, subversion 1 (v5.32.1) built for x86_64-linux-gnu-thread-multi
". Possibly different compilers or options used to build the executables. As somebody who has dealt with floating point issues, 10**(-16) in a operation return like this is frequently noise. I'd not expect perl to return exactly zero to sin(pi) and I don't get it, but 1.22464679914735e-16.
That's hinting at something, but I'm not quite sure what.
Tried (and hopefully succeeded) in fixing the formatting, so my reply isn't in my sig.
Information about American English usage here and here. Floating point issues? Please read this before posting. — emc
| [reply] [Watch: Dir/Any] |