Re: Singles to Doubles
- From: dpb <none@xxxxxxx>
- Date: Mon, 16 Jul 2007 15:39:51 -0500
Karl E. Peterson wrote:
Hi Bob --
What the heck? Seems silly to have to convert it to a String first, thenIsn't it mainly that the Single isn't representing the value as accurately?
to a Double. But, it is more accurate. Anyone know of a less ugly way to
accurately replicate a Single with a Double, or this the best it gets?
I guess, yeah. But how is it that a *String* seems to do so even more accurately?
No "guess" involved... :) "Yes".
The String conversion uses the i/o library and "cleans" up the representation for you that happens to be what you want in this case.
As a philosophy of promotion from Single to Double, except in the specific case such as you show here where it is known a priori (and from outside information) that the trailing digits of the value are, in fact, zeroes, the extension from single to double as done is, on the average, the more accurate representation of machine precision.
--
.
- References:
- Singles to Doubles
- From: Karl E. Peterson
- Re: Singles to Doubles
- From: Bob Butler
- Re: Singles to Doubles
- From: Karl E. Peterson
- Singles to Doubles
- Prev by Date: Re: How Do I Hide Excel process in VB?
- Next by Date: Re: Singles to Doubles
- Previous by thread: Re: Singles to Doubles
- Next by thread: Re: Singles to Doubles
- Index(es):
Loading