Re: Classic RW

From: Chuck Stevens (charles.stevens_at_unisys.com)
Date: 09/01/04


Date: Wed, 1 Sep 2004 10:20:40 -0700


"Robert Wagner" <robert@wagner.net.yourmammaharvests> wrote in message
news:iedbj091rf52f4jrjlatjjlo4tltoo2jgm@4ax.com...
> On Tue, 31 Aug 2004 11:23:44 -0700, "Chuck Stevens"
> <charles.stevens@unisys.com> wrote:
>
> >I know environments in which integers, fixed-point and floating-point
data
> >items are "stored in memory" identically; the only differentiation among
> >them is how they are handled and treated. In that environment, in fact,
> >there is no requirement that integer data actually *be* in "canonic
integer
> >form"; a normalized floating-point representation of the value serves
> >equally well and is just as exact a representation. Thus, in that
> >environment, a fixed-point numeric value may be stored, *not* as an
integer
> >defined for that implementation, but as a *floating-point* item that
happens
> >to have an exact value.
>
> That seems dangerous. If the program subtracts a small number from a
> large number, the hardware might lose decimals. The result would be
> the original large number, as though zero had been subtracted.

Depends on what you mean by "large" and "small". If the *values* are
*representable* as single-precision integers (magnitude no greater than
549,755,813,887) the subtraction produces exact results. Likewise, if the
values are contained in double-word operands, and are *representable* as
double-precision integers (magnitude no greater than
302,231,454,903,657,293,676,543), the subtraction will produce exact
results. It does not matter in either case whether the operands or the
results are integerized, normalized, or any of the various possible (exact)
representations in between.

    -Chuck Stevens



Relevant Pages

  • Re: Simple subtraction formula returning strange results = Excel g
    ... subtraction differ only in some number of the least significant bits ... The 64-bit floating-point representation is shown in the stylized hex form &hEEEMMMMM,M...M, where "E" is the biased exponent and "M" is the mantissa. ... always results in a zero in A3. ... A1 displays as 1.79769313486232E+308, but the first 30 digits of its exact representation are 179769313486231,57081452742373. ...
    (microsoft.public.excel.worksheet.functions)
  • Re: The spinoza papers: design of the extra-precision number object 2
    ... doesnt terminate, which cause practical problems, e.g in representation ... that we have an exact number. ... Limiting the precision doesn't change this claim. ... including quantum uncertainty represented as ...
    (comp.programming)
  • Re: Why cant I xor strings?
    ... a representation that does have parts and order etc. ... It's a matter of interpretation. ... I said they do represent _exact_ values, ... >who operates with "floats represent a value and have an error range around ...
    (comp.lang.python)
  • Re: Converting from Microsoft Binary Format floats to Python Float
    ... >floating point numbers, In a previous thread, Bengt Richter posted ... >that for one of the examples, the conversion isn't exact. ... not seeing a full representation of the two values. ...
    (comp.lang.python)
  • Re: ifstream bug in VS2005 Beta2 & Platform SDK
    ... So 3/25 and 7/40 are exact. ... Just about all languages use IEEE as the representation. ... What you have is a binary approximation, ... But converting the other way is inexact. ...
    (microsoft.public.vc.stl)