HOME

TheInfoList



OR:

Class Library for Numbers (CLN) is a free
library A library is a collection of materials, books or media that are accessible for use and not just for display purposes. A library provides physical (hard copies) or digital access (soft copies) materials, and may be a physical location or a vir ...
for arbitrary precision arithmetic. It operates on signed
integer An integer is the number zero (), a positive natural number (, , , etc.) or a negative integer with a minus sign ( −1, −2, −3, etc.). The negative numbers are the additive inverses of the corresponding positive numbers. In the languag ...
s,
rational numbers In mathematics, a rational number is a number that can be expressed as the quotient or fraction of two integers, a numerator and a non-zero denominator . For example, is a rational number, as is every integer (e.g. ). The set of all rat ...
,
floating point In computing, floating-point arithmetic (FP) is arithmetic that represents real numbers approximately, using an integer with a fixed precision, called the significand, scaled by an integer exponent of a fixed base. For example, 12.345 can b ...
numbers,
complex numbers In mathematics, a complex number is an element of a number system that extends the real numbers with a specific element denoted , called the imaginary unit and satisfying the equation i^= -1; every complex number can be expressed in the form ...
,
modular Broadly speaking, modularity is the degree to which a system's components may be separated and recombined, often with the benefit of flexibility and variety in use. The concept of modularity is used primarily to reduce complexity by breaking a s ...
numbers, and univariate
polynomial In mathematics, a polynomial is an expression consisting of indeterminates (also called variables) and coefficients, that involves only the operations of addition, subtraction, multiplication, and positive-integer powers of variables. An example ...
s. Its implementation
programming language A programming language is a system of notation for writing computer programs. Most programming languages are text-based formal languages, but they may also be graphical. They are a kind of computer language. The description of a programming ...
is
C++ C++ (pronounced "C plus plus") is a high-level general-purpose programming language created by Danish computer scientist Bjarne Stroustrup as an extension of the C programming language, or "C with Classes". The language has expanded significan ...
.


Details

CLN uses
object oriented Object-oriented programming (OOP) is a programming paradigm based on the concept of " objects", which can contain data and code. The data is in the form of fields (often known as attributes or ''properties''), and the code is in the form of p ...
techniques and
operator overloading In computer programming, operator overloading, sometimes termed ''operator ad hoc polymorphism'', is a specific case of polymorphism, where different operators have different implementations depending on their arguments. Operator overloading i ...
to achieve a natural
algebra Algebra () is one of the broad areas of mathematics. Roughly speaking, algebra is the study of mathematical symbols and the rules for manipulating these symbols in formulas; it is a unifying thread of almost all of mathematics. Elementary ...
ic syntax: The sum ''x'' of two variables ''a'' and ''b'' is written as ''x'' = ''a'' + ''b'', as opposed to the function sum(&''x'', ''a'', ''b''). CLN uses class inheritance to model the natural subsets of the available number types: E.g. the integer class is a subtype of the rational class, just as the integer numbers are a subset of the rational numbers. The complex numbers and all its subtypes behave exactly like the types of numbers known to the Common Lisp language, giving CLN another meaning: it becomes an abbreviation of ''Common Lisp Numbers''. Due to this, CLN can be and is used for implementations of Common Lisp, other interpreted languages, or
computer algebra system A computer algebra system (CAS) or symbolic algebra system (SAS) is any mathematical software with the ability to manipulate mathematical expressions in a way similar to the traditional manual computations of mathematicians and scientists. The d ...
s. The implementation is efficient. It can be configured to use the GNU Multi-Precision Library as kernel for speed-critical
inner loop Inner loop may refer to: * Inner loop in computer programs * Inner Loop (Phoenix), a section of Interstate 10 in downtown Phoenix, Arizona, United States * Inner Loop (Rochester), an expressway around downtown Rochester, New York, United States * I ...
s and implements advanced algorithms like Schönhage–Strassen multiplication, binary splitting and others. All CLN objects are either immediate or reference counted, providing for non-interruptive
garbage collection Waste collection is a part of the process of waste management. It is the transfer of solid waste from the point of use and disposal to the point of treatment or landfill. Waste collection also includes the curbside collection of recyclabl ...
with no burden on the main application.


References


External links


CLN website
{{Computer algebra systems Free software programmed in C++ Numerical libraries Pi-related software