Go to: Synopsis. Return value. MEL examples.

Synopsis

sign float

sign is NOT undoable, NOT queryable, and NOT editable.

Returns one of 3 possible floating point values:
  1. -1 if the argument is less than 0.
  2. 1 if the argument is greater than 0.
  3. 0 if the argument is 0.

Return value

floatSign of argument

MEL examples

sign -42.42;
// Result: -1 //
sign 3.14159;
// Result: 1 //
sign 0;
// Result: 0 //