OpenMath Content Dictionary: rounding1

Canonical URL:
http://www.openmath.org/cd/rounding1.ocd
CD Base:
http://www.openmath.org/cd
CD File:
rounding1.ocd
CD as XML Encoded OpenMath:
rounding1.omcd
Defines:
ceiling, floor, round, trunc
Date:
2004-03-30
Version:
3 (Revision 2)
Review Date:
2006-03-30
Status:
official


     This document is distributed in the hope that it will be useful, 
     but WITHOUT ANY WARRANTY; without even the implied warranty of 
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.

     The copyright holder grants you permission to redistribute this 
     document freely as a verbatim copy. Furthermore, the copyright
     holder permits you to develop any derived work from this document
     provided that the following conditions are met.
       a) The derived work acknowledges the fact that it is derived from
          this document, and maintains a prominent reference in the 
          work to the original source.
       b) The fact that the derived work is not the original OpenMath 
          document is stated prominently in the derived work.  Moreover if
          both this document and the derived work are Content Dictionaries
          then the derived work must include a different CDName element,
          chosen so that it cannot be confused with any works adopted by
          the OpenMath Society.  In particular, if there is a Content 
          Dictionary Group whose name is, for example, `math' containing
          Content Dictionaries named `math1', `math2' etc., then you should 
          not name a derived Content Dictionary `mathN' where N is an integer.
          However you are free to name it `private_mathN' or some such.  This
          is because the names `mathN' may be used by the OpenMath Society
          for future extensions.
       c) The derived work is distributed under terms that allow the
          compilation of derived works, but keep paragraphs a) and b)
          intact.  The simplest way to do this is to distribute the derived
          work under the OpenMath license, but this is not a requirement.
     If you have questions about this license please contact the OpenMath
     society at http://www.openmath.org.
  Author: OpenMath Consortium
  SourceURL: https://github.com/OpenMath/CDs
            

A CD of basic rounding concepts

Written by James Davenport, inspired by the need from bigfloat.ocd.
Finished 1999-10-24.

ceiling

Role:
application
Description:

The round up (to +infinity) operation.

Commented Mathematical property (CMP):
for all x | ceiling(x)-1 < x <= ceiling x
Formal Mathematical property (FMP):
x . ( ceiling ( x ) - 1 ) < x x ceiling ( x )
Signatures:
sts


[Next: floor] [Last: round] [Top]

floor

Role:
application
Description:

The round down (to -infinity) operation.

Commented Mathematical property (CMP):
for all x | floor(x) <= x < floor(x)+1
Formal Mathematical property (FMP):
x . x < ( floor ( x ) + 1 ) floor ( x ) x
Signatures:
sts


[Next: trunc] [Previous: ceiling] [Top]

trunc

Role:
application
Description:

The round to zero operation.

Commented Mathematical property (CMP):
for all x | trunc(x) <= x < trunc(x)+1 (x>0)
Formal Mathematical property (FMP):
x . x 0 x < ( trunc ( x ) + 1 ) trunc ( x ) x
Commented Mathematical property (CMP):
for all x | trunc(x) >= x > trunc(x)-1 (x<0)
Formal Mathematical property (FMP):
x . x 0 x > ( trunc ( x ) - 1 ) trunc ( x ) x
Signatures:
sts


[Next: round] [Previous: floor] [Top]

round

Role:
application
Description:

The round to nearest operation.

Commented Mathematical property (CMP):
for all x | x <= round(x)+1/2 and x >= round(x)-1/2
Formal Mathematical property (FMP):
x . x round ( x ) + 1 2 x round ( x ) - 1 2
Commented Mathematical property (CMP):
for all x | Also round to even in event of a tie
Formal Mathematical property (FMP):
x . ¬ ( x Z ) x 2 Z round ( x ) 2 Z
Signatures:
sts


[First: ceiling] [Previous: trunc] [Top]