Comment 1 for bug 870515

Revision history for this message
Matt Giuca (mgiuca) wrote :

The specific library changes will be:

Changes to existing functions:
- eq:Num and cmp will now perform floating-point comparisons.
- add, sub, mul will now perform floating-point arithmetic instead of integer arithmetic.
- div will perform integer division. Given two floating point numbers a and n, returns the largest integer q such that n*q <= a.
- mod will return the remainder after integer division. Given two floating point numbers a and n, and q as the result of div(a, n), returns r such that a = n*q + r.

New built-in functions:
- fdiv will perform floating-point division.
- trunc will round a number to the nearest integer towards 0.
- sqrt will find the square root of a number.

New prelude functions:
- round will round a number to the nearest integer.
- floor will round a number to the nearest integer towards -Inf.
- ceil will round a number to the nearest integer towards +Inf.

Changes to operator syntax:
- / will now be syntactic sugar for fdiv instead of div.
- // will be syntactic sugar for div.