contentsconceptssyntaxlibrariessampleserrorsindex
Full text search
function   FP_ceil    
  Related Syntax     Other Library Functions  

Library: Floating Point
Include: omfloat.xin
Returns: Opaque

The smallest multiple of "y" that is greater than or equal to "x".

Declaration

  define external float function FP_ceil (value float x, value float y optional)


Purpose

Rounds the floating point number "up" by returning the smallest multiple of "y" that is greater than or equal to "x". This function works in the same way as the C math function ceil: in all cases, "y" is rounded to precisions other than a simple integer. If "y" is omitted, it is set to 1.

This sample shows how to use FP_ceil to round numbers. The sample produces a result of 1.5, since 1.5 is the smallest number that is both evenly divisible by .5 and greater than 1.3.

  . . .
  set x to FP_v "1.3"
  set y to FP_v ".5"
  . . .
  set x to FP_ceil (x,y)
  output FP_d (x,2) || "%n"

    Related Syntax
   FP_floor
   FP_trunc
   FP_nearest
 
  Other Library Functions
   FP_abs
   FP_acos
   FP_add
   FP_asin
   FP_atan
   FP_atan2
   FP_ceil
   FP_cos
   FP_cosh
   FP_d
   FP_div
   FP_eq
   FP_exp
   FP_floor
   FP_ge
   FP_gt
   FP_hypot
   FP_isnan
   FP_isneg
   FP_ispos
   FP_iszero
   FP_j0
   FP_j1
   FP_jn
   FP_le
   FP_log
   FP_log10
   FP_lt
   FP_mod
   FP_mul
   FP_ne
   FP_nearest
   FP_neg
   FP_pow
   FP_s
   FP_sin
   FP_sinh
   FP_sqrt
   FP_sub
   FP_tan
   FP_tanh
   FP_trunc
   FP_v
   FP_y0
   FP_y1
   FP_yn
 
----  

Top [CONTENTS] [CONCEPTS] [SYNTAX] [LIBRARIES] [SAMPLES] [ERRORS] [INDEX]

Generated: April 21, 1999 at 2:01:05 pm
If you have any comments about this section of the documentation, send email to [email protected]

Copyright © OmniMark Technologies Corporation, 1988-1999.