Berserk Docs
Scalar FunctionsMath Functions

sign

Returns the sign of a numeric expression (-1, 0, or 1), preserving the input type.

Syntax

sign(x)

Parameters

Prop

Type

Returns: real

Examples

Example 1

print sign(- 5)
print_0 (long)
-1

On this page