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
 
Posted: 06:50am
06 May 2026
Copy link to clipboard
ville56
Guru

@Peter,

Beautify spoils labels ... in the attached code, after edit/^A/F2 there are spaces in front of the label b_loop: inserted and the code does fail with

[11] If in_str <> "" Then GoTo b_loop
Error : Cannot find label

Interestingly, there are seemingly 2 character positions inserted but if there is only one char to remove. The code runs again if the inserted chars (or char?) are removed.

Version is:
PicoMite MMBasic RP2350B V6.03.00RC1

failing code is:

 '
 OPTION EXPLICIT
 OPTION DEFAULT NONE
 
 Option tracecache on 128
 
 b_test("test")
 
end
 ' ------------ END main ----------------------------------

sub b_test(in_str as string)

b_loop:
 print "in b_loop"
 pause 300
 if in_str <> "" then goto b_loop

end sub
 
   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