Math Commands: Difference between revisions

From Bohemia Interactive Community
Jump to navigation Jump to search
mNo edit summary
m (tidying)
Line 1: Line 1:
<u>All</u> of these commands work with and / or return a generic type [[Number]].
'''All''' of these commands work with ''and/or'' return a generic type [[Number]].


In scripting language (unlike config's) there is no specialty types such as float or integer. All numeric values are represented solely as a [[Number]] type.
In the scripting language (unlike config's) there is no specialty types such as float or integer. All numeric values are represented solely as a [[Number]] type.


'''However''', specific commands listed below 'expect' specific types of value. Eg [[Number#Radians|Radians]], [[Number#Degrees|Degrees]], and floats.
'''However''', specific commands listed below ''expect'' specific types of value ''e.g.'' [[Number#Radians|Radians]], [[Number#Degrees|Degrees]], and floats.


Be aware that although not directly related to the list below '''many''' commands in the scripting language restrict the range of possible values. Particularly commands wanting ratio's between 0.0 and 1.0 (eg no integer > 1 is possible). Check individual documentation for the command itself)
Be aware that although not directly related to the list below '''many''' commands in the scripting language restrict the range of possible values. Particularly commands wanting ratios between <tt>0.0</tt> and <tt>1.0</tt> (''e.g.'' no <tt>''integer'' &gt; 1</tt> is possible). Check individual documentation for the command itself.


Also, the [[Boolean]] is a true type in command syntax. The results (the return value) of the below list should not be used directly in a boolean type expression
Also, the [[Boolean]] is a true type in command syntax. The results (the return value) of the below list should not be used directly in a boolean type expression(s).


a=abs -3
;Bad:<code>a = [[abs]] -3;<br>? (a) : [[exit]];</code>
? (a) : exit
 
bad
 
?  (a>0): exit
 
good


;Good:<code>? (a > 0) : [[exit]];</code>


==Commands==
<div style="-webkit-column-count:6;-moz-column-count:6;column-count:6;">
*[[abs]]
*[[abs]]
*[[acos]]
*[[acos]]
Line 42: Line 38:
*[[sqrt]]
*[[sqrt]]
*[[tan]]
*[[tan]]
</div>
==Relatia==
==Relatia==
*[[Number#Degrees|Degrees]]
*[[Number#Degrees|Degrees]]

Revision as of 09:15, 31 May 2014

All of these commands work with and/or return a generic type Number.

In the scripting language (unlike config's) there is no specialty types such as float or integer. All numeric values are represented solely as a Number type.

However, specific commands listed below expect specific types of value e.g. Radians, Degrees, and floats.

Be aware that although not directly related to the list below many commands in the scripting language restrict the range of possible values. Particularly commands wanting ratios between 0.0 and 1.0 (e.g. no integer > 1 is possible). Check individual documentation for the command itself.

Also, the Boolean is a true type in command syntax. The results (the return value) of the below list should not be used directly in a boolean type expression(s).

Bad
a = abs -3;
? (a) : exit;
Good
? (a > 0) : exit;

Commands

Relatia