Isign()

From TinyMUX
Jump to: navigation, search

Description

FUNCTION: 20px-Function.png isign(integer)

Returns -1, 0, or 1 depending on whether integer is negative, zero, or positive, respectively.

Related Topics: abs(), iabs(), sign().

Examples

> say isign(-4)
You say "-1"
> say isign(4)
You say "1"
> say isign(0)
You say "0"
> say isign(-1)
You say "-1"

(--Soylent 00:26, 3 December 2005 (EST))