Numerical tower

Numerical tower

In Scheme and some other Lisp dialects, a numerical tower is the set of data types that represent numbers in a given programming language.

Each type in the tower conceptually "sits on" a more fundamental type, so an integer is a rational number and a number, but the inverse is not necessarily true, i.e. not every number is an integer; this asymmetry implies that a language can allow implicit coercions of numerical types - without creating semantic problems - in only one direction: coercing an integer to a rational loses no information and does not affect the results of a function, but to coerce most reals to an integer could well result in a problem (for example, the real 1/3 does not equal any integer).

Scheme programming language, and also other Lisp dialects, defines all its arithmetic within this model.[1] Some given implementations may extend or adapt the tower. Kawa, for example, extends it with a Quantity type that is even more generic than Number. Smalltalk is another programming language that follows this model, but it has a Magnitude as superclass of Number. Another popular variant is having both exact and inexact versions of the tower or parts of it. Most languages and language implementations do not support a Scheme-like numerical tower. Some languages support it only in a limited way.

References

  1. ^ http://www.schemers.org/Documents/Standards/R5RS/HTML/r5rs-Z-H-9.html#%_sec_6.2.1



Wikimedia Foundation. 2010.

Игры ⚽ Нужна курсовая?

Look at other dictionaries:

  • Solar updraft tower — This article is about a type of power plant. For other uses, see Solar tower (disambiguation). Schematic presentation of a Solar updraft tower The solar updraft tower is a renewable energy power plant. It combines the chimney effect, the… …   Wikipedia

  • Type polymorphism — In computer science, polymorphism is a programming language feature that allows values of different data types to be handled using a uniform interface. The concept of parametric polymorphism applies to both data types and functions. A function… …   Wikipedia

  • Chicken (Scheme) — Chicken Aktuelle Version 4.7.0 (25. Mai 2011) Betriebssystem Plattformunabhängig Kategorie Programmiersprache Lizenz BSD …   Deutsch Wikipedia

  • Polymorphism (computer science) — This article is about the programming language theory concepts with direct application to functional programming languages. For a gentler introduction of these notions as commonly implemented in object oriented programming, see Polymorphism in… …   Wikipedia

  • Turret lathe — Hartness 3x36 flat turret lathe with cross sliding head, equipped for bar work, 1910.[1] The turret lathe is a form of metalworking lathe that is used for repetitive production of duplicate parts, which by the nature of their cutting process are… …   Wikipedia

  • biblical literature — Introduction       four bodies of written works: the Old Testament writings according to the Hebrew canon; intertestamental works, including the Old Testament Apocrypha; the New Testament writings; and the New Testament Apocrypha.       The Old… …   Universalium

  • number game — Introduction       any of various puzzles and games that involve aspects of mathematics.       Mathematical recreations comprise puzzles and games that vary from naive amusements to sophisticated problems, some of which have never been solved.… …   Universalium

  • Large numbers — This article is about large numbers in the sense of numbers that are significantly larger than those ordinarily used in everyday life, for instance in simple counting or in monetary transactions. The term typically refers to large positive… …   Wikipedia

  • JERUSALEM — The entry is arranged according to the following outline: history name protohistory the bronze age david and first temple period second temple period the roman period byzantine jerusalem arab period crusader period mamluk period …   Encyclopedia of Judaism

  • Timeline of Islamic science and engineering — This timeline of Islamic science and engineering covers the general development of science and technology in the Islamic world during the Islamic Golden Age, usually dated from the 7th to 16th centuries.From the 17th century onwards, the advances …   Wikipedia

Share the article and excerpts

Direct link
Do a right-click on the link above
and select “Copy Link”