stevepoole wrote:Hi all,
I wrote the program above with QPC2, which produced correct random scatter plots.
But on my QL, under QDOS or SMSQ, the scatter plots were not correct.
This is due to different 'BEEPING' polll return speeds, so there can be no universal program for all platforms...... Sorry !
After much experimentation, I cannot find any simple workarounds, so I shall have to throw in the towel.
Steve.
Steve,
I really like the idea of a true random number generator so thank you for turning me on to the idea. I'll pursue this a bit further moving forward. I'll look into this a bit more when my semester is over -- spring break has started but we are moving to online for the remainder and so there goes my spring break as I'll have to do some additional preparation :-/
The rounding of numbers to 7 digits that occurs when SAVing is because S*Basic programs are saved as ASCII files, so the internal representation of floating point numbers gets lost.
This is indeed a 'feature' of S*Basic I regularly ran across when I wrote programs for astronomical calculations which usually need numbers up to 10 or more digits accurate.
One way to avoid this would be to place the number in quotes, e.g. '36000.76892'. The coercion mechanism will automatically convert this 'string' to floating point, without loss of accuracy but at a slight speed penalty.
Another solution with less speed penalty is to write the number as two numbers which don't get truncated, e.g. (36000+0.76892).
The Q is for "quick". It used to take forever to load up a largish SuperBASIC program, but not with QSAVE/QLOAD, they save and load the tokenised binary version of the ASCII version that SAVE/LOAD prefer.
Cheers,
Norm.
Why do they put lightning conductors on churches?
Author of Arduino Software Internals
Author of Arduino Interrupts
NormanDunbar wrote:It is also built in to SMSQ if I'm not mistaken.
Quite right, TT has rewritten it, because the original version from Liberation SW depends on Sinclair ROMs (SMS - A brief history by TT). TT also implemented a QMERGE. The difference to the original toolkit is the omission to report unloaded extensions used while QSAVEing.