Search

( ceiling [ real? x ] ) real?
floor, ceiling, truncate, round These procedures return integers. The floor procedure returns the largest integer not larger than x. The ceiling procedure returns the smallest integer not smaller than x, truncate returns the integer closest to x whose absolute value is not larger than the absolute value of x, and round returns the closest integer to x, rounding to even when x is halfway between two integers. Rationale: The round procedure rounds to even for consistency with the default rounding mode specified by the IEEE 754 IEEE floating-point standard. Note: If the argument to one of these procedures is inexact, then the result will also be inexact. If an exact value is needed, the result can be passed to the exact procedure. If the argument is infinite or a NaN, then it is returned.
( char->integer [ char? char ] ) integer?
Given a Unicode character, char->integer returns an exact integer between 0 and #xD7FF or between #xE000 and #x10FFFF which is equal to the Unicode scalar value of that character. Given a non-Unicode character, it returns an exact integer greater than #x10FFFF. This is true independent of whether the implementation uses the Unicode representation internally. Given an exact integer that is the value returned by a character when char->integer is applied to it, integer->char returns that character.
( current-jiffy ) integer?
Returns the number of jiffies as an exact integer that have elapsed since an arbitrary, implementation-defined epoch. A jiffy is an implementation-defined fraction of a second which is defined by the return value of the jiffies-per-second procedure. The starting epoch is guaranteed to be constant during a run of the program, but may vary between runs. Rationale: Jiffies are allowed to be implementation-dependent so that current-jiffy can execute with minimum overhead. It should be very likely that a compactly represented integer will suffice as the returned value. Any particular jiffy size will be inappropriate for some implementations: a microsecond is too long for a very fast machine, while a much smaller unit would force many implementations to return integers which have to be allocated for most calls, rendering current-jiffy less useful for accurate timing measurements.
( current-second ) real?
Returns an inexact number representing the current time on the International Atomic Time (TAI) scale. The value 0.0 represents midnight on January 1, 1970 TAI (equivalent to ten seconds before midnight Universal Time) and the value 1.0 represents one TAI second later. Neither high accuracy nor high precision are required; in particular, returning Coordinated Universal Time plus a suitable constant might be the best an implementation can do.
( denominator [ rational? q ] ) integer?
numerator, denominator These procedures return the numerator or denominator of their argument; the result is computed as if the argument was represented as a fraction in lowest terms. The denominator is always positive. The denominator of 0 is defined to be 1.
( digit-value [ char? char ] ) ( or #f integer? )
This procedure returns the numeric value (0 to 9) of its argument if it is a numeric digit (that is, if char-numeric? returns #t), or #f on any other character.
( floor [ real? x ] ) integer?
floor, ceiling, truncate, round These procedures return integers. The floor procedure returns the largest integer not larger than x. The ceiling procedure returns the smallest integer not smaller than x, truncate returns the integer closest to x whose absolute value is not larger than the absolute value of x, and round returns the closest integer to x, rounding to even when x is halfway between two integers. Rationale: The round procedure rounds to even for consistency with the default rounding mode specified by the IEEE 754 IEEE floating-point standard. Note: If the argument to one of these procedures is inexact, then the result will also be inexact. If an exact value is needed, the result can be passed to the exact procedure. If the argument is infinite or a NaN, then it is returned.
( floor-quotient [ integer? n1 ] [ integer? n2 ] ) integer?
floor/, floor-quotient, floor-remainder, truncate/, truncate-quotient, truncate-remainder These procedures implement number-theoretic (integer) division. It is an error if n2 is zero. The procedures ending in / return two integers; the other procedures return an integer. All the procedures compute a quotient nq and remainder nr such that n1 = n2 * nq + nr.
( floor-remainder [ integer? n1 ] [ integer? n2 ] ) integer?
floor/, floor-quotient, floor-remainder, truncate/, truncate-quotient, truncate-remainder These procedures implement number-theoretic (integer) division. It is an error if n2 is zero. The procedures ending in / return two integers; the other procedures return an integer. All the procedures compute a quotient nq and remainder nr such that n1 = n2 * nq + nr.
( floor/ [ integer? n1 ] [ integer? n2 ] ) ( values integer? integer? )
floor/, floor-quotient, floor-remainder, truncate/, truncate-quotient, truncate-remainder These procedures implement number-theoretic (integer) division. It is an error if n2 is zero. The procedures ending in / return two integers; the other procedures return an integer. All the procedures compute a quotient nq and remainder nr such that n1 = n2 * nq + nr.
( gcd [ integer? n ] ... ) integer?
gcd, lcm These procedures return the greatest common divisor or least common multiple of their arguments. The result is always non-negative.
( jiffies-per-second ) integer?
Returns an exact integer representing the number of jiffies per SI second. This value is an implementation-specified constant.
( lcm [ integer? n ] ... ) integer?
gcd, lcm These procedures return the greatest common divisor or least common multiple of their arguments. The result is always non-negative.
( max [ real? x1 ] [ real? x2 ] ... ) real?
min, max These procedures return the maximum or minimum of their arguments. Note: If any argument is inexact, then the result will also be inexact (unless the procedure can prove that the inaccuracy is not large enough to affect the result, which is possible only in unusual implementations). If min or max is used to compare numbers of mixed exactness, and the numerical value of the result cannot be represented as an inexact number without loss of accuracy, then the procedure may report a violation of an implementation restriction.
( min [ real? x1 ] [ real? x2 ] ... ) real?
min, max These procedures return the maximum or minimum of their arguments. Note: If any argument is inexact, then the result will also be inexact (unless the procedure can prove that the inaccuracy is not large enough to affect the result, which is possible only in unusual implementations). If min or max is used to compare numbers of mixed exactness, and the numerical value of the result cannot be represented as an inexact number without loss of accuracy, then the procedure may report a violation of an implementation restriction.
( modulo [ integer? n1 ] [ integer? n2 ] ) integer?
quotient, remainder, modulo The quotient and remainder procedures are equivalent to truncate-quotient and truncate-remainder, respectively, and modulo is equivalent to floor-remainder.
( numerator [ rational? q ] ) integer?
numerator, denominator These procedures return the numerator or denominator of their argument; the result is computed as if the argument was represented as a fraction in lowest terms. The denominator is always positive. The denominator of 0 is defined to be 1.
( quotient [ integer? n1 ] [ integer? n2 ] ) integer?
quotient, remainder, modulo The quotient and remainder procedures are equivalent to truncate-quotient and truncate-remainder, respectively, and modulo is equivalent to floor-remainder.