Copyright (c) 2010, 2011, 2012 John Tobey firstname.lastname@example.org
Copyright (c) 2009 Matthew Crumley email@example.com
Licensed under the MIT license, file LICENSE.
#What is it?
The Scheme language supports "exact" arithmetic and mixing exact with inexact numbers. Several basic operations, including add, subtract, multiply, and divide, when given only exact arguments, must return an exact, numerically correct result. They are allowed to fail due to running out of memory, but they are not allowed to return approximations the way ECMAScript operators may.
This implementation provides all functions listed in the R6RS
(I recommend the PDF) Scheme specification, Section 11.7, along
eqv? from Section 11.5. (
Exact numbers support the standard ECMA Number formatting methods
toPrecision) without a fixed upper
limit to precision.
This release contains a plugin API designed to support alternative implementations of four broad types: exact integer, exact rational, inexact real, and complex. The plugin API is under heavy development and neither complete nor documented. A multiple dispatch system supports specialization of basic operations by any operands' types.
Exact integers of absolute value less than 2 to the 53rd power (9,007,199,254,740,992 or about 9e15) are represented as native numbers. Outside this range, exact integers are represented as BigInteger objects: arrays base 10000000 with sign flag.
Exact rationals are represented as pairs of exact integers (numerator, denominator) in lowest terms.
Non-real complex numbers are represented in rectangular coordinates, either both exact or both inexact.
Inexact real numbers are represented as native numbers, wrapped to provide a method space without affecting the standard Number.prototype object.
Number objects may contain properties and methods other than the
standard toString, toFixed, etc. Such properties have names beginning
SN_. They are private to the library, and applications
should not use them. The Scheme functions are not methods of number
Leemon Baird's big integer library (http://www.leemon.com/crypto/BigInt.js).
HOP (http://hop.inria.fr/), a framework containing a Scheme-to-JS compiler that did NOT implement the numeric tower as of 2011.
node-gmp (https://github.com/postwait/node-gmp), node.js bindings for the GNU Multiple Precision Arithmetic Library.
Any others out there???
1.3.0 (unstable) - 2012-03-07
* Unstable development branch containing new plugin API.
1.2.0 - 2012-03-04 - Current stable release based on 1.1.x.
1.1.5 (unstable) - 2012-03-01
* Fixed parser bug affecting numbers like "#e.021".
1.1.2 (unstable) - 2011-03-19
* Do not modify the standard Number.prototype object.
1.0.1 - 2011-02-10 - First numbered release.
See file CHANGES.md for more.