Re: Singles to Doubles
- From: dpb <none@xxxxxxx>
- Date: Tue, 17 Jul 2007 22:56:24 -0500
Michael C wrote:
"dpb" <none@xxxxxxx> wrote in message news:f7k006$kav$1@xxxxxxxxxxxNo, 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???
--
.
- Follow-Ups:
- Re: Singles to Doubles
- From: dpb
- Re: Singles to Doubles
- References:
- Singles to Doubles
- From: Karl E. Peterson
- Re: Singles to Doubles
- From: Bob Butler
- Re: Singles to Doubles
- From: Karl E. Peterson
- Re: Singles to Doubles
- From: Jim Mack
- Re: Singles to Doubles
- From: Michael C
- Re: Singles to Doubles
- From: dpb
- Re: Singles to Doubles
- From: Michael C
- Re: Singles to Doubles
- From: dpb
- Re: Singles to Doubles
- From: Michael C
- Singles to Doubles
- Prev by Date: Re: Problem changing Attributes of a file
- Next by Date: Re: Singles to Doubles
- Previous by thread: Re: Singles to Doubles
- Next by thread: Re: Singles to Doubles
- Index(es):
Relevant Pages
|
Loading