help-bison
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: 3DLDF


From: Frank Heckenbach
Subject: Re: 3DLDF
Date: Sat, 14 Aug 2004 01:50:45 +0100
User-agent: semail 20040101

Hans Aberg wrote:

> At 21:28 +0100 2004/08/13, Frank Heckenbach wrote:
> >> It clearly so that in some computer language paradigms, the word "real" is
> >> used instead of the mathematically correct term "float". C/C++, however, do
> >> it correctly.
> >
> >Want to start a language war?
> >
> >Well, I'm a mathematician and I haven't heard the term "float" (or a
> >German equivalent) used anywhere in mathematics except in computer
> >programs in C etc.
> 
> Floating point numbers are quite common in applied math, for example
> physics.

That's not the question. Your claim was that the *term "float"* was
mathematically correct. I don't see any evidence of that.

> >I suppose you refer to the fact that floating point numbers can't
> >represent all real numbers, but neither can the integer type of C
> >and many other languages represent all integers, etc.
> 
> Mathematical real numbers can be represented in computers, in for example
> theorem provers, and to some extent symbolic algebra programs.

Any computer can only represent countably many numbers, i.e. "almost
none" of the real numbers. You can represent a different subset that
floating point numbers (say, expressions involving pi, e and certain
integrals), but it's still a small subset, and calling such a type
"real" is/isn't just as justified than calling a floating-point type
"real".

> A language
> has both the type Integer, for multiprecision integers, and Int for
> interfacing with C "int". The types "int" and so forth in C, are called
> "integral types", not integers, in its paradigm;

AFAIK, "integral" is just the adjective to "integer". Since "real"
is both a noun and an adjective, it seems just as well suited.
(I.e., if you mean "a type of some integral numbers" instead of "the
set of all integers", I could say just as well "a type of some real
numbers" instead of "the set of all reals").

> so the C folk seems to
> have thought this through a bit more than others language constructors.
> Strictly speaking, the C integral types are binary types with some mod 2^n
> arithmetic available.

With the emphasis on some. C's int division is not quite division
mod 2^n.

And the n (i.e., type size) is undefined, but wraparound is
specified (AFAIK), so 70 * 1000 can be equal to or not equal to
4464, depending on the environment. No sorry, I fail to see a close
relationship between C's arithmetics and mathematical concepts.

Frank

-- 
Frank Heckenbach, address@hidden
http://fjf.gnu.de/
GnuPG and PGP keys: http://fjf.gnu.de/plan (7977168E)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]