Difference between revisions of "Abs"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Moses
imported>Moses
Line 23: Line 23:
This formula can be used in place of this function when OBSE is not installed.
This formula can be used in place of this function when OBSE is not installed.


  A = a * ((a > 0) + ((a < 0) * -1))
  set a to a * ((a > 0) + ((a < 0) * -1))


[[Category: Functions]]
[[Category: Functions]]

Revision as of 19:59, 25 April 2010

A command for Oblivion Script Extender

Syntax:

abs [float]

Returns the absolute value of a number, i.e. it's distance from zero, i.e. always positive

Example

set n to abs -54

n = 54

set n to abs 54

n = 54




This formula can be used in place of this function when OBSE is not installed.

set a to a * ((a > 0) + ((a < 0) * -1))