Imaginary base numbers: Difference between revisions

m
→‎{{header|Raku}}: Fix comment: Perl 6 --> Raku
m (→‎{{header|Phix}}: Fix comments: Perl 6 --> Raku)
m (→‎{{header|Raku}}: Fix comment: Perl 6 --> Raku)
Line 2,848:
(formerly Perl 6)
{{works with|Rakudo|2017.01}}
These are generalized imaginary-base conversion routines. They only work for imaginary bases, not complex. (Any real portion of the radix must be zero.) Theoretically they could be made to work for any imaginary base; in practice, they are limited to integer bases from -6i to -2i and 2i to 6i. Bases -1i and 1i exist but require special handling and are not supported. Bases larger than 6i (or -6i) require digits outside of base 36 to express them, so aren't as standardized, are implementation dependent and are not supported. Note that imaginary number coefficients are stored as floating point numbers in Perl 6Raku so some rounding error may creep in during calculations. The precision these conversion routines use is configurable; we are using 6 <strike>decimal</strike>, um... radicimal(?) places of precision here.
 
Implements minimum, extra kudos and stretch goals.
2,392

edits