__abs__ - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


__abs__

compute absolute value of Expression

__ceil__

compute ceiling of Expression

__floor__

compute floor of Expression

__neg__

compute negation of Expression

__round__

compute rounded value of Expression

__trunc__

compute truncated value of Expression

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

x.__abs__()

abs(x)

x.__ceil__()

ceil(x)

x.__floor__()

floor(x)

x.__neg__()

neg(x)

x.__round__()

round(x)

x.__trunc__()

trunc(x)

Parameters

x

-

Expression object

Description

• 

__abs__ function returns the absolute value of the Expression x.

• 

This function can also be called by simply entering abs(x).

• 

__ceil__ function returns the ceiling of the Expression x.

• 

This function can also be called by simply entering ceil(x).

• 

__floor__ function returns the floor of the Expression x.

• 

This function can also be called by simply entering floor(x).

• 

__neg__ function negates the Expression x.

• 

This function can also be called by simply entering neg(x).

• 

__round__ function rounds the Expression x.

• 

This function can also be called by simply entering round(x).

• 

__trunc__ function truncates the Expression x.

• 

This function can also be called by simply entering trunc(x).

Examples

The following interactive session illustrates the use of these operators:

>>> import maple

>>> import maple.namespace

>>> expr = maple.execute('-1 * Pi:');

>>> # It is most natural to use these functions in prefix form without underscores

>>> abs(expr)

Pi

>>> ceil(expr)

-3

>>> floor(expr)

-4

>>> neg(expr)

Pi

>>> round(expr)

-3

>>> trunc(expr)

-3

>>> # They may however also be used with the expr.methodName syntax

>>> expr.__abs__()

Pi

>>> expr.__ceil__()

-3

>>> expr.__floor__()

-4

>>> expr.__neg__()

Pi

>>> expr.__round__()

-3

>>> expr.__trunc__()

-3

See Also

OpenMaple

OpenMaple/Python/API

OpenMaple/Python/Expression