ACSUtils Wiki

An ACS library for ZDoom-based ports

User Tools

Site Tools


functions:sgn

Table of Contents

sgn

Description

Returns the sign of x as an integer.

  • 1 – x is positive
  • 0 – x is zero
  • -1 – x is negative

Examples

sgn(    7) -> 1
sgn(   -7) -> -1
sgn( 12.3) -> 1
sgn(-12.3) -> -1
sgn(    0) -> 0
functions/sgn.txt · Last modified: 2017/03/15 10:39 by korshun