Last modified on 13 November 2012, at 10:49

REBOL Programming/sign?

USAGE:Edit

SIGN? number 

DESCRIPTION:Edit

Returns sign of number as 1, 0, or -1 (to use as multiplier).

SIGN? is a function value.

ARGUMENTSEdit

  • number -- (Type: number money time)

SOURCE CODEEdit

sign?: func [
    {Returns sign of number as 1, 0, or -1 (to use as multiplier).} 
    number [number! money! time!]
][
    either positive? number [1] [either negative? number [-1] [0]]
]