From: Dennis Lee Bieber <wlfraed@ix.netcom.com>
Subject: Re: casting types
Date: Wed, 01 Oct 2014 21:47:54 -0400
Date: 2014-10-01T21:47:54-04:00 [thread overview]
Message-ID: <17bp2a16ha7bgtamuvboqhvhlhdv17tp9r@4ax.com> (raw)
In-Reply-To: m0he6b$dn1$1@online.de
On Wed, 01 Oct 2014 19:38:22 +0200, Dirk Heinrichs
<dirk.heinrichs@altum.de> declaimed the following:
{responding to Stribor40}
>Stribor40 wrote:
>
>> i would like to represent all numbers in interval [0, 1]
>
>Well, according to what I've learned in mathematics, you can't. Neither in
>real life, nor in any programming language. You need to define some
>constraint, like number of digits after the decimal point.
>
And on most machines these days -- you can expect the hardware to
support single precision (32-bit) with ~7 significant digits, double
precision (64-bit) with ~15 significant digits... And only within the
floating point processor, maybe IEEE 80-bit (downconverted when the final
result is returned to the user).
Note that "significant digits" does not take into account the decimal
point...
12300000.0, 1.23, 0.00000123
all have 3 significant digits if they are /floating point/ values (they are
all 1.23E<some exponent>)
Fixed point types are closer to integers with an implied decimal point.
--
Wulfraed Dennis Lee Bieber AF6VN
wlfraed@ix.netcom.com HTTP://wlfraed.home.netcom.com/
next prev parent reply other threads:[~2014-10-02 1:47 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-01 1:49 casting types Stribor40
2014-10-01 2:06 ` Jeffrey Carter
2014-10-01 2:13 ` Stribor40
2014-10-01 2:56 ` Stribor40
2014-10-01 13:18 ` Dennis Lee Bieber
2014-10-01 13:55 ` Stribor40
2014-10-01 14:23 ` G.B.
2014-10-01 17:16 ` Stribor40
2014-10-01 17:38 ` Dirk Heinrichs
2014-10-02 1:47 ` Dennis Lee Bieber [this message]
2014-10-01 18:11 ` Jeffrey Carter
2014-10-02 9:21 ` Brian Drummond
2014-10-02 9:24 ` Brian Drummond
2014-10-03 3:35 ` Stribor40
2014-10-03 7:45 ` Björn Lundin
2014-10-03 8:29 ` Jacob Sparre Andersen
2014-10-06 23:36 ` brbarkstrom
2014-10-07 0:03 ` Jeffrey Carter
2014-10-07 0:21 ` brbarkstrom
replies disabled
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox