This article is about the command to get the real part of a complex number. For the command to only display real numbers, see Real.

:real(value)

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

imag( returns b, the part real( does not return. `real(A)+imag(A)i=A`

would return true.

## Location Edit

- (MATH)
*CPX*- 2:real(

## Example Edit

PROGRAM:REAL :ClrHome :Input "Value: ",N :real(N)→R :If R≠0 :Then :Output(2,1,"THE REAL PART IS") :Output(3,1,R) :Pause :Stop :End :If R=0 :Then :Output(2,1,"THE NUMBER HAS") :Output(3,1,"NO REAL PART") :Pause :Stop :End

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