Data update
This commit is contained in:
parent
4d5544505c
commit
4924dd0264
3073 changed files with 55820 additions and 4408 deletions
30
Task/Arithmetic-Complex/ArkScript/arithmetic-complex.ark
Normal file
30
Task/Arithmetic-Complex/ArkScript/arithmetic-complex.ark
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
(import std.Math)
|
||||
|
||||
(let a (math:complex 1 1))
|
||||
(let b (math:complex 3.75 1.25))
|
||||
|
||||
(assert
|
||||
(=
|
||||
(math:complex-add a b)
|
||||
(math:complex 4.75 2.25))
|
||||
"complex add")
|
||||
(assert
|
||||
(=
|
||||
(math:complex-mul a b)
|
||||
(math:complex 2.5 5))
|
||||
"complex mul")
|
||||
(assert
|
||||
(=
|
||||
(math:complex-mul (math:complex -1 0) a)
|
||||
(math:complex -1 -1))
|
||||
"complex negation")
|
||||
(assert
|
||||
(=
|
||||
(math:complex-div (math:complex 1 0) a)
|
||||
(math:complex 0.5 -0.5))
|
||||
"complex inversion")
|
||||
(assert
|
||||
(=
|
||||
(math:complex-conjugate a)
|
||||
(math:complex 1 -1))
|
||||
"complex conjugate")
|
||||
Loading…
Add table
Add a link
Reference in a new issue