Menu
JAQForum Ver 19.10.27

Forum Index : Microcontroller and PC projects : MMBasic V6.03.00 release candidates

   Page 2 of 2    
Posted: 08:25pm
05 May 2026
Copy link to clipboard
Geoffg
Guru


This is a typical example of floating point error.  Calculation errors in floating-point math are not "bugs" in the language but a fundamental limitation of storing infinite decimals in finite space.

The issue here is that 0.1 cannot be represented exactly in binary. Every time you press a key, a tiny rounding error is added to a. Eventually, you’ll see values like 0.3000000000000001 or 0.6999999999999999.In BASIC dialects (like MMBasic), the most reliable fix is to calculate with integers and scale the output for the display.
 
Posted: 09:18pm
05 May 2026
Copy link to clipboard
JohnS
Guru

Some examples of programming around it often use a small value - search on epsilon (or floating point epsilon) as that's what it tends to be called.

John
 
Posted: 09:42pm
05 May 2026
Copy link to clipboard
DaveJacko
Regular Member

Thanks for beautify, Peter,
great help for hobbyists with older brains and eyes
along with fred777 and toml,


I do think that leaving blank lines intact for readability would be better

(more blank lines, for emphasis)


thanks, Dave
 
Posted: 05:37am
06 May 2026
Copy link to clipboard
terekgabor
Regular Member

@matherp

Peter!

Just a small idea. Can be good if we can use string variable (not only unquoted constant string) for object names in STAR and ASTRO commands.

Better way to build up a kind of epheneris program for example.

G@bor
 
   Page 2 of 2    


To reply to this topic, you need to log in.

The Back Shed's forum code is written, and hosted, in Australia.
© JAQ Software 2026