@# @# This is the source for the Adime docs, in Allegro's custom format. Read @# allegro/docs/makedoc.c for a description of what is going on... @# @ignore_css @multiwordheaders @#locale=latin1 @document_title=Adime - Syntax of Numerical Expressions @html_footer=Back to Contents @rtfh=Adime Expressions @$\input texinfo @$@setfilename expressi.inf @$@settitle Adime Expressions @$@setchapternewpage odd @$@paragraphindent 0 @$@setchapternewpage off @# This should remain commented at the moment (dvi output) @$@finalout @$ @$@ifinfo @$@direntry @$* Adime Expressions: (expressi). About Expressions in Adime @$@end direntry @$This is the Info version of the Adime Expressions Manual @$ @$By Sven Sandberg @$@end ifinfo @$ @$@node Top, , (dir), (dir) @
@!indent

                              _      _ _
                             /_\  __| (_)_ __  ___
                            / _ \/ _` | | '  \/ -_)
                           /_/ \_\__,_|_|_|_|_\___|

                           Allegro Dialogs Made Easy

                        Syntax of Numerical Expressions

                              by Shawn Hargreaves


@indent
@
@headingnocontent Expressions This section completely describes the expressions that can be typed in the input fields for "%cint", "%cfloat" and "%cdouble" formats. See also the Authors section in readme.txt and the adime_evaluate() function in adime.txt. The whole section is cut from the EGG system by Shawn Hargreaves. For more info, see the the authors section in readme.txt. Numbers may be written in decimal (e.g. 42, 1.2345) or in hex (e.g. 0xDEADBEEF). Boolean logic works identically to C, with zero representing false and nonzero being true. Binary operators:
   +        addition
   -        subtraction (may be unary negation, depending on context)
   *        multiplication
   /        division
   ^        raising to a power
   %        integer modulus (remainder after division)
   |        logical 'or'
   &        logical 'and'
   ==       equality test
   !=       inequality test
   <        less than test
   <=       less than or equal to test
   >        greater than test
   >=       greater than or equal to test
Unary operators:
   -        negation (may be binary subtraction, depending on context)
   !        logical 'not'
   sqrt     square root
   sin      sine (angle in degrees)
   cos      cosine (angle in degrees)
   tan      tangent (angle in degrees)
   asin     inverse sine (angle in degrees)
   acos     inverse cosine (angle in degrees)
   atan     inverse tangent (angle in degrees)
   log      base 10 logarithm
   ln       natural logarithm
   ceil     round up to the next larger integer
   floor    round down to the next smaller integer
   round    round to the closest integer
   abs      absolute value
Special values:
   rand     a random number between zero and one (inclusive)
   pi       3.14159...
   e        2.71828...
Operator precedence (lowest at the top):
   |  &
   <  >  ==  !=  <=  >=
   +  -
   *  /  %
   ^
   !  sqrt sin cos tan asin acos atan log ln ceil floor round abs
Differences from C syntax: