Re: Singles to Doubles



Michael C wrote:
"dpb" <none@xxxxxxx> wrote in message news:f7k006$kav$1@xxxxxxxxxxx
No, different process entirely. One is promoting a Single to a Double, the other is re-reading an input string (in effect)...

So? You've just restated an already established fact and haven't responded to my post at all. I am saying that they could have provided the same accuracy and have not due to some reason. That reason could be laziness or it could be speed, although I doubt speed would be an issue today.

It is neither...it is design decision/specification of promotion.

In internal promotion from lower precision to higher, there isn't any information as to what the missing decimal digits should be -- that they should be zero is only one of a large set of possible values. So, lacking that information, the technique used (by other language Standards such as Fortran and C as well as VB) is to set the extended bits to zero.

OTOH, when the data is output to an ASCII representation of N digits, the same thing is true--there is no additional information about what those _decimal_ digits are. The standard way (which would be deemed pretty unsatisfactory by most users if it were anything else) is again to set those trailing (again decimal) digits to zero and convert that number _as if it were_ exactly x.xxx0000... to the precision of the data size receiving the input.

So, it's the same assumption, just depends on whether it is made in external decimal representation or the internal, binary one.

So, Karl's customers wanted their data to continue to look more like the x.xxxx or whatever level of precision they were used to and when expanded to higher precision they instinctively wanted trailing _decimal_ digits to print as zero. The way to force that in any modern language I'm familiar with is essentially what we've been discussing here...make a decimal representation that looks like the number you want and then let the i/o routines read that in, doing the hard work of converting its internal representation to match as closely as possible.

Have I come any closer???

--
.



Relevant Pages

  • Re: How to increase Working Precision?
    ... I don't get credit for letting "generally outstanding" slip by? ... and 9.95, with three correct digits. ... It printed as zero because it ... is deemed to have too little precision to print otherwise ...
    (sci.math.symbolic)
  • Re: Calendrical centering
    ... Detonation of the first A-bomb July 16, ... That's a reason I like the end of the Younger Dryas as a zero point. ... Digital watches would need to carry 18 digits, ... Moreover, the setting of today's current time lacks a bit of precision, ...
    (talk.origins)
  • Re: Calendrical centering
    ... Detonation of the first A-bomb July 16, ... That's a reason I like the end of the Younger Dryas as a zero point. ... Digital watches would need to carry 18 digits, ... Moreover, the setting of today's current time lacks a bit of precision, ...
    (talk.origins)
  • Re: How do I stop Excel from changing last digit in a number entry?
    ... Excel can only show up to 15 digits of precision, ... changes the last digit to a zero. ...
    (microsoft.public.excel.newusers)
  • Re: float bug? perl 5.8, DBI and oracle 10.2.0
    ... precision numbers in oracle, you've got 38 decimal digits to play ... and with minimal coaxing perl will handle them as ... digits from a 32 bit floating point number - I'll go out on a limb ... and hazard that one can expect 12 or so digits from a 64 bit floating ...
    (perl.dbi.users)

Loading