Data commit
This commit is contained in:
parent
7387c8f97b
commit
cb5bb5e222
199093 changed files with 3378972 additions and 0 deletions
13
Task/Arithmetic-Complex/Frink/arithmetic-complex.frink
Normal file
13
Task/Arithmetic-Complex/Frink/arithmetic-complex.frink
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
add[x,y] := x + y
|
||||
multiply[x,y] := x * y
|
||||
negate[x] := -x
|
||||
invert[x] := 1/x // Could also use inv[x] or recip[x]
|
||||
conjugate[x] := Re[x] - Im[x] i
|
||||
|
||||
a = 3 + 2.5i
|
||||
b = 7.3 - 10i
|
||||
println["$a + $b = " + add[a,b]]
|
||||
println["$a * $b = " + multiply[a,b]]
|
||||
println["-$a = " + negate[a]]
|
||||
println["1/$a = " + invert[a]]
|
||||
println["conjugate[$a] = " + conjugate[a]]
|
||||
Loading…
Add table
Add a link
Reference in a new issue