DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH
 

(guile.info.gz) Arithmetic

Info Catalog (guile.info.gz) Complex (guile.info.gz) Numbers (guile.info.gz) Scientific
 
 21.2.11 Arithmetic Functions
 ----------------------------
 
  -- Scheme Procedure: + z1 ...
      Return the sum of all parameter values.  Return 0 if called
      without any parameters.
 
  -- Scheme Procedure: - z1 z2 ...
      If called with one argument Z1, -Z1 is returned. Otherwise the sum
      of all but the first argument are subtracted from the first
      argument.
 
  -- Scheme Procedure: * z1 ...
      Return the product of all arguments.  If called without arguments,
      1 is returned.
 
  -- Scheme Procedure: / z1 z2 ...
      Divide the first argument by the product of the remaining
      arguments.  If called with one argument Z1, 1/Z1 is returned.
 
  -- Scheme Procedure: abs x
  -- C Function: scm_abs (x)
      Return the absolute value of X.
 
      X must be a number with zero imaginary part.  To calculate the
      magnitude of a complex number, use `magnitude' instead.
 
  -- Scheme Procedure: max x1 x2 ...
      Return the maximum of all parameter values.
 
  -- Scheme Procedure: min x1 x2 ...
      Return the minimum of all parameter values.
 
  -- Scheme Procedure: truncate
      Round the inexact number X towards zero.
 
  -- Scheme Procedure: round x
      Round the inexact number X to the nearest integer.  When exactly
      halfway between two integers, round to the even one.
 
  -- Scheme Procedure: floor x
      Round the number X towards minus infinity.
 
  -- Scheme Procedure: ceiling x
      Round the number X towards infinity.
 
    For the `truncate' and `round' procedures, the Guile library exports
 equivalent C functions, but taking and returning arguments of type
 `double' rather than the usual `SCM'.
 
  -- C Function: double scm_truncate (double x)
  -- C Function: double scm_round (double x)
 
    For `floor' and `ceiling', the equivalent C functions are `floor'
 and `ceil' from the standard mathematics library (which also take and
 return `double' arguments).
 
Info Catalog (guile.info.gz) Complex (guile.info.gz) Numbers (guile.info.gz) Scientific
automatically generated byinfo2html