Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Force 4.0 Reference - itrunc() truncate a number to an integer http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
 itrunc()            Truncate a number to an integer
------------------------------------------------------------------------------
 Declaration
   math.hdr

 Syntax
   func long itrunc extern
   param value dbl eNumber

 Arguments
   eNumber is the numeric to convert.

 Return
   The truncated value of the passed numeric.

 Description
   The itrunc() function truncates its argument to an integer and returns
   it as an int. The result is an implicit dbl-to-int conversion.

   By using the itrunc() function loss of precision warning messages
   by the compiler can be avoided.

 Example
   #define EXAMPLE_MATH
   #include example.hdr

   proc Test_itrunc
   ? itrunc( -10.1 )      // prints -10
   ? itrunc( -10.9 )      // prints -10
   ? itrunc(  10.1 )      // prints  10
   ? itrunc(  10.9 )      // prints  10
   endproc

   proc main
   Test_itrunc()
   endproc

See Also: iround() trunc()

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson