DOC HOME SITE MAP MAN PAGES GNU INFO SEARCH PRINT BOOK
 

(guile.info.gz) Exactness

Info Catalog (guile.info.gz) Complex Numbers (guile.info.gz) Numbers (guile.info.gz) Number Syntax
 
 21.2.5 Exact and Inexact Numbers
 --------------------------------
 
 R5RS requires that a calculation involving inexact numbers always
 produces an inexact result.  To meet this requirement, Guile
 distinguishes between an exact integer value such as `5' and the
 corresponding inexact real value which, to the limited precision
 available, has no fractional part, and is printed as `5.0'.  Guile will
 only convert the latter value to the former when forced to do so by an
 invocation of the `inexact->exact' procedure.
 
  -- Scheme Procedure: exact? x
  -- C Function: scm_exact_p (x)
      Return `#t' if X is an exact number, `#f' otherwise.
 
  -- Scheme Procedure: inexact? x
  -- C Function: scm_inexact_p (x)
      Return `#t' if X is an inexact number, `#f' else.
 
  -- Scheme Procedure: inexact->exact z
  -- C Function: scm_inexact_to_exact (z)
      Return an exact number that is numerically closest to Z.
 
  -- Scheme Procedure: exact->inexact z
      Convert the number Z to its inexact representation.
 
Info Catalog (guile.info.gz) Complex Numbers (guile.info.gz) Numbers (guile.info.gz) Number Syntax
automatically generated byinfo2html