Talk:Numerical tower

Where do IEEE 754 floats fit in this tower? Do -0.0, +Inf and NaN fit in with "Real"? Or (in my opinion) is this tower an artificial construct with little basis in practical computing? —The preceding unsigned comment was added by 213.114.96.51 (talk • contribs).


 * According to R5RS, IEEE floats may be used to represent numbers inexactly. Using floats for real numbers seems to be the usual practice. By that standard, the presence of ±Inf, NaN and −0 would be implementation-dependent. For example, Chicken implements them, whereas, according to, Scheme 48 does not. More generally, the hierarchy just expresses the fact that, but for minor issues, $$\mathbb{C} \supset \mathbb{R} \supset \mathbb{Q} \supset \mathbb{Z} \supset \mathbb{N}$$, which is something that non-sadistic language designers will usually not dispute by specifying something different. What you choose as an implementation of those things is up to you (although, if I may voice an opinion here, it is generally a good idea to implement both the C99-style types and arbitrary precision types). —xyzzyn 14:32, 7 June 2006 (UTC)

If you think that the set of ints, rationals, reals, etc. are the the only sorts of sets then the previous comment makes some sense. IEEE 754 floats can approximate numbers from those sets. However, IEEE floats are exact numbers and its set includes numbers which cannot be represented using any of $$\mathbb{C}, \mathbb{R} , \mathbb{Q} , \mathbb{Z}$$ or $$\mathbb{N}$$. In addition, fundamental requirements for a group fail for 754 (eg, x can equal x+1.0, the identity element under addition is not equal to its complement). Hence the set and operations defined by IEEE 754 are not and cannot be part of the "numerical tower". It can at best be used to implement such a tower but then it's better to use integer math.

Computer Science?
This article simply does not describe a computer science topic. It seems to be describing mathematical analysis at a high-school level. As pointed out above, actual computers don't implement the various sets of numbers that are discussed in this stub. Netuser500 00:41, 19 January 2007 (UTC)


 * Actually, this is a computer science topic. The similarity to mathematics is superficial. For mathematicians, the issue of number types is pretty much non-existent (since the inclusions work by definition), while in the design of programming languages (and maybe hardware), it is quite important to specify the exact relationship between the layers of the tower. Actual computers do implement the various sets of numbers that are discussed, only those sets are not the same as the ones used by mathematicians. Or, if you want to get technical, computers implement quotients of the ‘mathematical’ sets and the tower illustrates the desired way of how the inclusion properties should be preserved under projection to the equivalence classes.
 * Well, anyway, since such considerations matter only in computer science, it’s a computer science topic instead of a mathematics topic. —xyzzyn 00:57, 19 January 2007 (UTC)


 * Actually, in computer science, (for the overwhelming majority of programming languages) there are only two "fundamental" data types that deal with numbers. One is a subset of the integers, the other is a subset of the rationals. All work with reals, complex, and quaternions is done by using multiple floating point numbers. Each floating point number is rational. I must agree that what happens in computers is only superficially similar to mathematics. That's why the (upside-down) numerical tower is not applicable to real computer science. Fundamentally, all data values are integers. Netuser500 16:47, 19 January 2007 (UTC)


 * Well, you can certainly code anything that’s a computer datum as an integer, but if we actually viewed things this way, we might as well delete the string article. Many programming languages do closely reflect the capabilities of the hardware, which usually only works with integers and maybe floats, but there are enough languages that take a higher-level view. That view shouldn’t be neglected just because it reduces to something else. —xyzzyn 17:11, 19 January 2007 (UTC)


 * Netuser: Of course this is "real computer science". Ever implement a language? You can use whatever subtyping scheme you like. And if you want to be a jerk, then the only fundamental datatype, numeric or otherwise, is a word (by which I mean a bitstring of an agreed-upon length, such as 8, 16, 32 or 64). 65.183.135.231 (talk) 16:25, 24 March 2009 (UTC)

Scheme
Scheme programming language uses this terminology:

In R5RS (1) (current standard)

Mathematically, numbers may be arranged into a tower of subtypes in which each level is a subset of the level above it:
 * number
 * complex
 * real
 * rational
 * integer

In R6RS (2) (draft for next standard):

The full numeric tower is now required.

So please don't delete the article. I have no knowledge to improve it, but I think it should remain or, at least, should be made a section of a broader article. --189.12.141.71 06:58, 24 June 2007 (UTC)