User Tools


This shows you the differences between two versions of the page.

Link to this comparison view

cl:types:number [2017/05/01 21:00] (current)
Line 1: Line 1:
 +====== System Class NUMBER ======
 +====Class Precedence List==== ​
 +**number**, **[[CL:​Types:​t]]**
 +The type **number** contains //​[[CL:​Glossary:​object|objects]]//​ which represent mathematical numbers.
 +The //​[[CL:​Glossary:​type|types]]//​ **[[CL:​Types:​real]]** and **[[CL:​Types:​complex]]** are //​[[CL:​Glossary:​disjoint]]//​ //​[[CL:​Glossary:​subtype|subtypes]]//​ of **number**.
 +The //​[[CL:​Glossary:​function]]//​ **[[CL:​Functions:​math-equal|=]]** tests for numerical equality. The //​[[CL:​Glossary:​function]]//​ **[[CL:​Functions:​eql]]**,​ when its arguments are both //​[[CL:​Glossary:​number|numbers]]//,​ tests that they have both the same //​[[CL:​Glossary:​type]]//​ and numerical value.
 +Two //​[[CL:​Glossary:​number|numbers]]//​ that are the //​[[CL:​Glossary:​same]]//​ under **[[CL:​Functions:​eql]]** or **[[CL:​Functions:​math-equal|=]]** are not necessarily the //​[[CL:​Glossary:​same]]//​ under **[[CL:​Functions:​eq]]**.
 +Common Lisp differs from mathematics on some naming issues. In mathematics,​ the set of real numbers is traditionally described as a subset of the complex numbers, but in Common Lisp, the type **[[CL:​Types:​real]]** and the type **[[CL:​Types:​complex]]** are disjoint. The Common Lisp type which includes all mathematical complex numbers is called **number**. The reasons for these differences include historical precedent, compatibility with most other popular computer languages, and various issues of time and space efficiency.