Initial data commit
This commit is contained in:
parent
72d218235f
commit
f23f22d71c
199087 changed files with 3378941 additions and 0 deletions
17
Task/Arithmetic-Complex/Smart-BASIC/arithmetic-complex.basic
Normal file
17
Task/Arithmetic-Complex/Smart-BASIC/arithmetic-complex.basic
Normal file
|
|
@ -0,0 +1,17 @@
|
|||
' complex numbers are native for "smart BASIC"
|
||||
A=1+2i
|
||||
B=3-5i
|
||||
|
||||
' all math operations and functions work with complex numbers
|
||||
C=A*B
|
||||
PRINT SQR(-4)
|
||||
|
||||
' example of solving quadratic equation with complex roots
|
||||
' x^2+2x+5=0
|
||||
a=1 ! b=2 ! c=5
|
||||
x1=(-b+sqr(b^2-4*a*c))/(2*a)
|
||||
x2=(-b-sqr(b^2-4*a*c))/(2*a)
|
||||
print x1,x2
|
||||
|
||||
' gives output
|
||||
-1+2i -1-2i
|
||||
Loading…
Add table
Add a link
Reference in a new issue