Complex conjugate: Difference between revisions

Undo revision 131180 by Glennj (talk)
(add Tcl)
(Undo revision 131180 by Glennj (talk))
Line 20:
# Numeric#conj or Numeric#conjugate returns self.
puts 67.conjugate # 67</lang>
 
=={{header|Tcl}}==
{{tcllib|math::complexnumbers}}
<lang tcl>package require math::complexnumbers
namespace import math::complexnumbers::*
foreach x {{2 3} {4 -5} {67 0}} {
set c [complex {*}$x]
puts "[tostring $c] conjucate is [tostring [conj $c]]"
}</lang>
Produces the output
<pre>
2+3i conjucate is 2-3i
4-5i conjucate is 4+5i
67 conjucate is 67</pre>
Anonymous user