Difference between revisions of "LC"

From the Oblivion ConstructionSet Wiki
Jump to navigation Jump to search
imported>Speedo
(Created)
 
imported>Low Post
 
(6 intermediate revisions by 2 users not shown)
Line 4: Line 4:


'''Syntax:'''
'''Syntax:'''
  (Result:long) LC Formula:string ''$0:long $1:long ... $8:long $9:long''
  (Result:long) LC Rounded:bool Formula:string ''$0:long $1:long ... $8:long $9:long''


The Oblivion [[Set]] command will create errors when doing calculations on a variable less than -8,388,608 or greater than 8,388,607. When dealing with integer variables outside of that range, this function can be used to perform accurate calculations.
Used to perform accurate calculations on very large or very small integer variables, as the Oblivion [[Set]] command is only accurate for variables within the range [-8,388,608, 8,388,607].
 
==Notes==
*If Rounded is different than 0, then result is rounded to the closest integer.
*LC ignores all characters in Formula but 0 1 2 3 4 5 6 7 8 9 . $ + - * / % ( ) p.
*LC accepts floats as constant in the Formula string.
*LC accepts a lowcase p as a Power operator.


==Example==
==Example==
  set Result to LC "$0 – ( $1 + $2 / $4 ) % $0 * $3" Long0 Long1 Long2 1478 Long4
  set Result to LC 0 "$0 – ( $1 + $2 / $4 ) % $0 * $3" Long0 Long1 Long2 1478 Long4
 
==See also==
[[StrLC]]


[[Category: Functions (Pluggy)]]
[[Category: Functions (Pluggy)]]

Latest revision as of 09:02, 26 April 2009


A command for Pluggy.

Syntax:

(Result:long) LC Rounded:bool Formula:string $0:long $1:long ... $8:long $9:long

Used to perform accurate calculations on very large or very small integer variables, as the Oblivion Set command is only accurate for variables within the range [-8,388,608, 8,388,607].

Notes[edit | edit source]

  • If Rounded is different than 0, then result is rounded to the closest integer.
  • LC ignores all characters in Formula but 0 1 2 3 4 5 6 7 8 9 . $ + - * / % ( ) p.
  • LC accepts floats as constant in the Formula string.
  • LC accepts a lowcase p as a Power operator.

Example[edit | edit source]

set Result to LC 0 "$0 – ( $1 + $2 / $4 ) % $0 * $3" Long0 Long1 Long2 1478 Long4

See also[edit | edit source]

StrLC