Imaginary base numbers: Difference between revisions
Content added Content deleted
Thundergnat (talk | contribs) m (syntax highlighting fixup automation) |
Alextretyak (talk | contribs) m (→{{header|11l}}: Static type variables are supported now) |
||
Line 317: | Line 317: | ||
V denom = c.real * c.real + c.imag * c.imag |
V denom = c.real * c.real + c.imag * c.imag |
||
R Complex(c.real / denom, -c.imag / denom) |
R Complex(c.real / denom, -c.imag / denom) |
||
⚫ | |||
V QuaterImaginary_invTwoI = inv(QuaterImaginary_twoI) |
|||
T QuaterImaginary |
T QuaterImaginary |
||
⚫ | |||
:invTwoI = inv(.:twoI) |
|||
String b2i |
String b2i |
||
Line 338: | Line 338: | ||
I k > 0 |
I k > 0 |
||
sum += prod * k |
sum += prod * k |
||
prod *= |
prod *= .:twoI |
||
I pointPos != -1 |
I pointPos != -1 |
||
prod = |
prod = .:invTwoI |
||
L(j) posLen + 1 .< .b2i.len |
L(j) posLen + 1 .< .b2i.len |
||
V k = Int(.b2i[j]) |
V k = Int(.b2i[j]) |
||
I k > 0 |
I k > 0 |
||
sum += prod * k |
sum += prod * k |
||
prod *= |
prod *= .:invTwoI |
||
R sum |
R sum |
||