Arithmetic/Complex: Difference between revisions
Rename Perl 6 -> Raku, alphabetize, minor clean-up
No edit summary |
Thundergnat (talk | contribs) (Rename Perl 6 -> Raku, alphabetize, minor clean-up) |
||
Line 251:
NumPut( Cre(A)/d,C,0,"double")
NumPut(-Cim(A)/d,C,8,"double")
}</lang>
=={{header|BASIC}}==
Line 3,714:
1 / $a, # multiplicative inverse
~$a; # complex conjugate</lang>
=={{header|Perl 6}}==▼
{{works with|Rakudo|2015.12}}▼
<lang perl6>my $a = 1 + i;▼
my $b = pi + 1.25i;▼
.say for $a + $b, $a * $b, -$a, 1 / $a, $a.conj;▼
.say for $a.abs, $a.sqrt, $a.re, $a.im;</lang>▼
{{out}} (precision varies with different implementations):▼
<pre>▼
4.1415926535897931+2.25i▼
1.8915926535897931+4.3915926535897931i▼
-1-1i▼
0.5-0.5i▼
1-1i▼
1.4142135623730951▼
1.0986841134678098+0.45508986056222733i▼
1▼
1▼
</pre>▼
=={{header|Phix}}==
Line 4,173 ⟶ 4,152:
(conjugate a) ; conjugation
</lang>
(formerly Perl 6)
▲{{works with|Rakudo|2015.12}}
▲<lang perl6>my $a = 1 + i;
▲my $b = pi + 1.25i;
▲.say for $a + $b, $a * $b, -$a, 1 / $a, $a.conj;
▲.say for $a.abs, $a.sqrt, $a.re, $a.im;</lang>
▲{{out}} (precision varies with different implementations):
▲<pre>
▲4.1415926535897931+2.25i
▲1.8915926535897931+4.3915926535897931i
▲-1-1i
▲0.5-0.5i
▲1-1i
▲1.4142135623730951
▲1.0986841134678098+0.45508986056222733i
▲1
▲1
▲</pre>
=={{header|REXX}}==
|