signum

signum

Overview

The signum function is used to extract the sign of the given input values. It returns 1.0 if the input decimal is positive, -1.0 if it is negative, and 0.0 if it is 0.

Return Type

Syntax

<variable>=<number>.signum();
(or)
<variable>=signum(<number>);

where,

ParameterData typeDescription
<variable>DECIMALVariable that will hold the output value.
<number>DECIMAL/ NUMBERVariable that holds the input decimal value.

Examples

 number = 25.125432;
 info number.signum();// Returns 1.0
 number = -12;
 info signum(number);// Returns -1.0
​
 number = 0;
 info number.signum();// Returns 0.0

Share this post : FacebookTwitter

Still can't find what you're looking for?

Write to us: support@zohodeluge.com