Euler's identity
Implementing an "invisible times" operator (Unicode character (U+2062)) to more closely emulate the layout. Alas, Raku does not do symbolic calculations at this time and is limited to IEEE 754 floating point for transcendental and irrational number calculations.
e, i and π are all available as built-in constants in Raku.
sub infix:<> is tighter(&infix:<**>) { $^a * $^b };
say 'e**iπ + 1 ≅ 0 : ', e**iπ + 1 ≅ 0;
say 'Error: ', e**iπ + 1;
Output:
e**iπ + 1 ≅ 0 : True
Error: 0+1.2246467991473532e-16i
Last updated
Was this helpful?