Singles to Doubles
- From: "Karl E. Peterson" <karl@xxxxxxxx>
- Date: Mon, 16 Jul 2007 12:32:46 -0700
Hi Folks --
Not sure I ever noticed this before, as I really haven't used Singles "forever"
(thinking back to DOS days) now. But when I needed to convert a whole boatload of
Single values to Doubles this morning, I noted some really funky conversions. For
example, try this in the Immediate window, with virtually any random number you care
to:
s=0.564!:?cdbl(s),cdbl(cstr(s))
0.564000010490417 0.564
s=0.3026!:?cdbl(s),cdbl(cstr(s))
0.302599996328354 0.3026
What the heck? Seems silly to have to convert it to a String first, then 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?
Thanks... Karl
--
..NET: It's About Trust!
http://vfred.mvps.org
.
- Follow-Ups:
- Re: Singles to Doubles
- From: Tony Proctor
- Re: Singles to Doubles
- From: Bob Butler
- Re: Singles to Doubles
- Prev by Date: Re: VB DLL called from ASP under Win 2003
- Next by Date: Re: VB DLL called from ASP under Win 2003
- Previous by thread: VB DLL called from ASP under Win 2003
- Next by thread: Re: Singles to Doubles
- Index(es):
Relevant Pages
|