Arithmetic/Complex: Difference between revisions

m
→‎{{header|Sidef}}: updated code and output
m (→‎{{header|Sidef}}: updated code and output)
Line 4,257:
 
=={{header|Sidef}}==
<lang ruby>var a = 1:1; # Complex(1, 1)
var b = 3.14159:1.25; # Complex(3.14159, 1.25)
 
[ a + b, # addition
a * b, # multiplication
-a, # negation
1 / a.inv, # multiplicative inverse
~a.conj, # complex conjugate
a.abs, # abs
a.sqrt, # sqrt
Line 4,275:
-1-i
0.5-0.5i
-21-i
1.4142135623730950488016887242097
1.4142135623731
1.09868411346780996603980119524068+0.45508986056222734130435775782247i
1.09868411346781+0.455089860562227i
3.14159
1.25</pre>
2,747

edits