cyclone/docs/api/srfi/143.md
Justin Ethier c24e58f7aa Fix link
2017-08-09 13:03:10 +00:00

157 lines
2.3 KiB
Markdown

# SRFI 143 - Fixnums
This SRFI describes arithmetic procedures applicable to a limited range of exact integers only. These procedures are semantically similar to the corresponding generic-arithmetic procedures, but allow more efficient implementations.
See the [SRFI document](http://srfi.schemers.org/srfi-143/srfi-143.html) for more information.
## Constants
[`fx-width`](#fx-width)
[`fx-greatest`](#fx-greatest)
[`fx-least`](#fx-least)
## Predicates
[`fixnum?`](#fixnum)
[`fx=?`](#fx)
[`fx<?`](#fx-1)
[`fx>?`](#fx-2)
[`fx<=?`](#fx-3)
[`fx>=?`](#fx-4)
[`fxzero?`](#fxzero)
[`fxpositive?`](#fxpositive)
[`fxnegative?`](#fxnegative)
[`fxodd?`](#fxodd)
[`fxeven?`](#fxeven)
[`fxmax`](#fxmax)
[`fxmin`](#fxmin)
## Basic arithmetic
[`fx+`](#fx-5)
[`fx-`](#fx-)
[`fx*`](#fx-6)
[`fxneg`](#fxneg)
[`fxquotient`](#fxquotient)
[`fxremainder`](#fxremainder)
[`fxabs`](#fxabs)
[`fxsquare`](#fxsquare)
[`fxsqrt`](#fxsqrt)
# Bitwise operations
[`fxnot`](#fxnot)
[`fxand`](#fxand)
[`fxior`](#fxior)
[`fxxor`](#fxxor)
[`fxarithmetic-shift`](#fxarithmetic-shift)
[`fxarithmetic-shift-left`](#fxarithmetic-shift-left)
[`fxarithmetic-shift-right`](#fxarithmetic-shift-right)
[`fxbit-count`](#fxbit-count)
[`fxlength`](#fxlength)
[`fxif`](#fxif)
[`fxbit-set?`](#fxbit-set)
[`fxcopy-bit`](#fxcopy-bit)
[`fxfirst-set-bit`](#fxfirst-set-bit)
[`fxbit-field`](#fxbit-field)
[`fxbit-field-rotate`](#fxbit-field-rotate)
[`fxbit-field-reverse`](#fxbit-field-reverse)
# fx-width
(fx-width)
Bound to the value `w` that specifies the implementation-defined fixnum integer range.
# fx-greatest
(fx-greatest)
Returns value of the largest representable fixnum.
# fx-least
(fx-least)
Returns value of the smallest representable fixnum.
# fixnum?
(fixnum? obj)
Returns `#t` if `obj` is an exact integer within the fixnum range, and `#f` otherwise.
# fx=?
(fx=? i j)
Semantically equivalent to `=`.
# fx<?
# fx>?
# fx<=?
# fx>=?
# fxzero?
# fxpositive?
# fxnegative?
# fxodd?
# fxeven?
# fxmax
# fxmin
# fx+
# fx-
# fx*
# fxneg
# fxquotient
# fxremainder
# fxabs
# fxsquare
# fxsqrt
# fxnot
# fxand
# fxior
# fxxor
# fxarithmetic-shift
# fxarithmetic-shift-left
# fxarithmetic-shift-right
# fxbit-count
# fxlength
# fxif
# fxbit-set?
# fxcopy-bit
# fxfirst-set-bit
# fxbit-field
# fxbit-field-rotate
# fxbit-field-reverse