Whilst working on the new OPL, I wondered how floats were displayed, more specifically, when does the display flip to mantissa plus exponent.
A short program:
When run, you can see that the integer display format is used even when the number displayed is longer than the mantissa/exponent format, which I found a bit odd. has anyone seen a description of how floats are displayed anywhere in a manual?
Interesting to see. I guess the writers of OPL didn't care too much about this because they had it covered by GEN$() or SCI$(). https://www.jaapsch.net/psion/manlzpg.htm#GEN_
Note that CALC is better and swaps to exponent form when one line of the screen is full.
That's interesting especially the way it pads out with zeros upto 18 digits. The Calculator (XP & LZ) stops at 15 before converting to exponent - probably because of the screen limits.
Andrew you will know this but for others watching... Page 106 of the republished technical reference manual. The Maths functions section has a floating-point number section.
When working in OPL I never trusted the Organiser to display numbers correctly and always use the FIX$ function. This way I can place it exactly where I want it on the screen.
Interesting that you are working on your 'new' opl. Do you think it will 'port' to other platforms? Andriod? If I could run OPL on a mobile phone then I might buy one.
MartinP wrote: ↑Mon Jun 03, 2024 9:46 am
Interesting to see. I guess the writers of OPL didn't care too much about this because they had it covered by GEN$() or SCI$(). https://www.jaapsch.net/psion/manlzpg.htm#GEN_
Note that CALC is better and swaps to exponent form when one line of the screen is full.
Hmm, interesting, as that implies the number display code is different between the calculator and OPL. I'm surprised they didn't re-use code considering how ROM space is limited.
There's also only 12 digits in a FLOAT, so any digits after that are just zeros.
Martin wrote: ↑Mon Jun 03, 2024 10:17 am
That's interesting especially the way it pads out with zeros upto 18 digits. The Calculator (XP & LZ) stops at 15 before converting to exponent - probably because of the screen limits.
Andrew you will know this but for others watching... Page 106 of the republished technical reference manual. The Maths functions section has a floating-point number section.
When working in OPL I never trusted the Organiser to display numbers correctly and always use the FIX$ function. This way I can place it exactly where I want it on the screen.
Interesting that you are working on your 'new' opl. Do you think it will 'port' to other platforms? Andriod? If I could run OPL on a mobile phone then I might buy one.
Sincerely
Martin
Don't get too excited, there's a long way to go before anything very useful is going to appear. It is written in C, though, as I want to run it on the Pico and recreation, so it should port to anything with C available. That is almost anything, really. Android is java based, though, although I think there's a framework for C, I think. Well, maybe. On a phone you also have a lot of graphical infrastructure to put together.