FANDOM



:imag(value)

This takes a complex number, and determines what the imaginary part of the number is. For a complex number in the form a+bi, this would return b. imag returns a real number.

real( returns a, the part imag discards. real(A)+imag(A)i=A would return true.

Location Edit

  1. (MATH)
  2. CPX
  3. 3:imag(

Example Edit

PROGRAM:IMAG
:ClrHome
:Input "Value: ",N
:imag(N)→>I
:If I0
:Then
:Output(2,1,"THE IMAGINARY")
:Output(3,1,"PART IS")
:Output(4,1,I)
:Pause
:Stop
:End
:If I=0
:Then
:Output(2,1,"THE NUMBER HAS")
:Output(3,1,"NO IMAGINARY")
:Output(4,1,"PART")
:Pause
:Stop
:End

This program will ask the user to input a value. If the number has an imaginary part, it will print the imaginary part. Otherwise, it will print that the number has no imaginary part.

Ad blocker interference detected!


Wikia is a free-to-use site that makes money from advertising. We have a modified experience for viewers using ad blockers

Wikia is not accessible if you’ve made further modifications. Remove the custom ad blocker rule(s) and the page will load as expected.