Re: Euler's identity in Raku
by syphilis (Archbishop) on Jun 03, 2021 at 05:27 UTC
|
Why is the fancy part not 0?
Because the estimation used for "pi" is not exactly equal to pi.
For the imaginary part of the result to be zero, you need to multiply "i" by exactly pi.
Cheers, Rob | [reply] |
|
Wouldn't e have to be pure also?
| [reply] |
|
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] [d/l] |
|
|
|
|
A reply falls below the community's threshold of quality. You may see it by logging in. |
Re: Euler's identity in Raku
by perlfan (Vicar) on Jun 04, 2021 at 00:45 UTC
|
rakumonks.org is still available and cheap, just sayin' | [reply] |
|
| [reply] |
|
| [reply] |
|
it doesn't look so (it doesn't look up at all)
| [reply] |
|
They mean the domain name is available/unused. As of right now, all three of big ones are: com, net, org.
| [reply] |
|
|