sign

get the sign of given number


Parameters

sign number :integer :floating :complex :rational :quantity

Returns

  • :integer

Examples

copy
sign 5 ; => 1 sign 0 ; => 0 sign neg 3 ; => -1

copy
sign 2.5 ; => 1 sign 0.0 ; => 0 sign neg 1.7 ; => -1

copy
sign to :rational [3 4] ; => 1 sign to :rational @[neg 3 4] ; => -1

copy
sign to :complex @[pi 1] ; => 1 sign to :complex @[0 neg 1] ; => -1

Related