Function reference · Complex

realpart

Returns the real part of a complex expression.

Products and sums are multiplied out first. If the real part can't be separated, the call is returned unevaluated.

Notation

realpart(args)

Write it in an expression: nerdamer('realpart(3+2*i)'), or in the Playground.

nerdamer.realpart

nerdamer.realpart(...args: [a]): Expression

A method on the default import. Arguments can be strings, as in Notation.

Examples

A number.

realpart(3+2*i)
// → 3
Open in Playground

A product, multiplied out.

realpart((a+b*i)*(c+d*i))
// → a*c-b*d
Open in Playground

Can't be separated: unevaluated.

realpart(sin(x+i))
// → realpart(sin(x+i))
Open in Playground

← Back to Function reference