gettingstarted
[Top] [All Lists]

Re: Turning off sci.notation?

To: Getting Started <gettingstarted at lists dot realsoftware dot com>
Subject: Re: Turning off sci.notation?
From: Seth Willits <seth at freaksw dot com>
Date: Wed, 27 Apr 2005 13:15:49 -0700
Delivered-to: gettingstarted at lists dot realsoftware dot com
References: <001a01c5484d$5dc2b410$1a974154 at newa8bavxwdlz0> <426FE352 dot C531A3DC at online dot no> <f75b94f571b903507a16a76324e094f9 at freaksw dot com> <426FEE77 dot C62D82BB at online dot no>
On Apr 27, 2005, at 12:56 PM, Eirik Karlsen wrote:

No, doesn't work.
The Format won't handle floating point number 'properly' because
of the x.xxxxxxx notation. Also there are rounding errors....

    y=-99.9990000  'for testing only

So I did a small test.


  dim y as Double
  y = -99.9990000
  self.Title = Format(y, "-0.00000000000000")


Yields -99.99900000000000 as it should, but

  dim y as Double
  y = -99.9990000
  self.Title = Format(y, "-0.000000000000000") // One more zero


Has accuracy problems and returns something like -99.99852.......

I wonder how the IDE's debugger handles it, because it shows -99.999 and that's it. If I use

y = -99.999999999999912345

The IDE shows -99.99999999999991, and Format shows y = -99.999999999999914735


The IDE appears to know something. :)




Seth Willits
----------------------------------------------------------
Freak Software - http://www.freaksw.com/
ResExcellence - http://www.resexcellence.com/realbasic/
----------------------------------------------------------

_______________________________________________
Unsubscribe or switch delivery mode:
<http://www.realsoftware.com/support/listmanager/>

Search the archives of this list here:
<http://support.realsoftware.com/listarchives/lists.html>

<Prev in Thread] Current Thread [Next in Thread>