*FLOAT64 Test    ~15 sig fig accuracy!  Is "Stardance" affected?


To quote Richard Russell's Help file re this new facility added in BB4W Version 2.00a  Jan 2003:

In *FLOAT40 mode floating-point (real) numbers have approximately a 9 significant-figure accuracy; in *FLOAT64 mode they have approximately a 15 significant-figure accuracy. BBC BASIC for Windows runs no more slowly in *FLOAT64 mode (in fact, it runs more quickly because it uses the CPU's numeric data processor) but floating-point numeric variables and arrays occupy more memory.

I thought it would be interesting to test this out using the "Stardance" program in the demo programs. The test devised tracks a particular star out to 20,000 screen units and then reports its x-position and the number of program loops carried out for the 3 star test system to reach this point. (For test's listing, click here).

Result:

*FLOAT64    1633 loops      first x value over 20,000 = 20,002.4841

*FLOAT40    1633 loops      first x value over 20,000 = 20,002.4854

It does  make a wee difference......65 parts per billion in this case! Possibly significant though for the future of our universelet.

Richard Weston's Homepage