On Jun 30, 2008, at 2:02 PM, Markus Winter wrote:
v as double
v = 12345678901234567890.1234567890
EF1.text = Format(v,
"-
#########################################################.##########
##
####
######################################")
produces
12345678901234567168.
Markus, a double only offers, I believe, 17 digits of accuracy. You
have exceeded that by a long shot. To handle a number like that would
require a double double, a 16 byte double I believe. There is someone
who offers an RB package that gives you basically unlimited number
sizes as well as a ton of other mathematics but I cannot remember the
authors name or the name of the package that he offers. I am sure
someone else will remember.
I think a double should easily hold a 20 digit number. Otherwise it
would be
the worst implementation in any programming language ever.
Totally untrue. I believe the (bit) format of a double is specified
by some IEEE standard. Bit 63 is the sign bit (of the mantissa, I
believe), then you have some bits for the exponent (which has an
integral value from -308 to +308, IIRC), then the remaining bits for
the mantissa. No matter how you stir it, you have to sacrifice
something to get a good dynamic range for both the mantissa and
exponent values. I believe that most FP instructions (with the
exception of the Moto 68k series) in microprocessors today conform to
this standard, but I could be wrong.
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>
Search the archives:
<http://support.realsoftware.com/listarchives/lists.html>
|