42s Code Editor - floats issue
05-02-2015, 06:56 PM
Post: #1
 pito Member Posts: 127 Joined: Jun 2014
42s Code Editor - floats issue
Hi, working with 42s Code Editor (1.0.2) and having this issue:
the float numbers are converted to hex (see attached)within the editor somehow, but after upload of the .raw to the free42 (win7, decimal) I see in the 42s a null ("0"). Any hint how to get the numbers in?
Thanks!

Attached File(s) Thumbnail(s)

05-02-2015, 07:06 PM (This post was last modified: 05-02-2015 07:08 PM by Mark Hardman.)
Post: #2
 Mark Hardman Senior Member Posts: 432 Joined: Dec 2013
RE: 42s Code Editor - floats issue
(05-02-2015 06:56 PM)pito Wrote:  Hi, working with 42s Code Editor (1.0.2) and having this issue:
the float numbers are converted to hex (see attached)within the editor somehow, but after upload of the .raw to the free42 (win7, decimal) I see in the 42s a null ("0"). Any hint how to get the numbers in?
Thanks!

The 42s only has 11 digits of precision. Try rounding to 11 places.

Tried this on a real 42s and on Free42. Neither allowed more than 11 digits after the decimal in PGM mode.

Ceci n'est pas une signature.
05-02-2015, 07:37 PM (This post was last modified: 05-02-2015 07:42 PM by pito.)
Post: #3
 pito Member Posts: 127 Joined: Jun 2014
RE: 42s Code Editor - floats issue
(05-02-2015 07:06 PM)Mark Hardman Wrote:  The 42s only has 11 digits of precision. Try rounding to 11 places.
Tried this on a real 42s and on Free42. Neither allowed more than 11 digits after the decimal in PGM mode.
Thanks!
I see the first two numbers now, the third is zero (see below attached).

The new issue I see is I cannot use E-2 notation, editor shoots an error, grrh.
Code:
0.02715245941 ok 0.027152459412 does not fit, shows zero in free42 2.7152459412E-2 (or shorter) shoots an error in editor (err opcode) 271524594118E-13 (or shorter) shoots an error in editor (err opcode)

I wonder why free42 cannot accept up to 25 digits numbers..

Attached File(s) Thumbnail(s)

05-02-2015, 08:00 PM (This post was last modified: 05-02-2015 08:02 PM by pito.)
Post: #4
 pito Member Posts: 127 Joined: Jun 2014
RE: 42s Code Editor - floats issue
ok I've found the trick - the "E" is a special character in the editor, so it must me copied from the "program tool".. A normally typed "E" shoots the error.
Now
271524594118E-13 ( 1217111512141519141111181B1C111300 )
fits and shows in the free42 as

05-02-2015, 10:15 PM
Post: #5
 Mark Hardman Senior Member Posts: 432 Joined: Dec 2013
RE: 42s Code Editor - floats issue
(05-02-2015 08:00 PM)pito Wrote:   ok I've found the trick - the "E" is a special character in the editor, so it must me copied from the "program tool".. A normally typed "E" shoots the error.
Now
271524594118E-13 ( 1217111512141519141111181B1C111300 )
fits and shows in the free42 as

You can also enter the exponent symbol ('E') by holding down the alt key and typing 0152 on the numeric keypad.

Ceci n'est pas une signature.
05-03-2015, 01:36 PM
Post: #6
 Graan Member Posts: 65 Joined: Dec 2013
RE: 42s Code Editor - floats issue
Might add a "normal" E as exponent as well. Some years ago I worked on this program , but have not been working on it since.
Found out that some raw programs written in Emu42 might give some errors due to some differencies in addressing. A workaround would be to import the program to Free42 then export the raw file and open it in the Code Editor. I did not bother to handle the differencies.

/Andreas
05-03-2015, 03:52 PM (This post was last modified: 05-03-2015 11:56 PM by pito.)
Post: #7
 pito Member Posts: 127 Joined: Jun 2014
RE: 42s Code Editor - floats issue
(05-03-2015 01:36 PM)Graan Wrote:  Might add a "normal" E as exponent as well. Some years ago I worked on this program , but have not been working on it since.
Yea, the E is tricky. I would recommend to use a normal "E" (or to accept both). Basically I am trying to run various programs which are posted by the contributors in the "listing format" with line numbers (line numbers with or without a dot), and with some issues with "-", "/" "*" etc. characters.
I was thinking to write a filter to cut off the line numbers, but I did it in programmer's notepad (check regex and replace ^\d with nothing).
I think it would be worth to enhance/refresh your editor as the free42 might become more popular with the availability of cheap and powerful smartphones (and with 2048kB free mem for code (~1mil lines) you may need a good editor, indeed )
There are basically 3-4 styles people publish their sources - .42s format, listings from 42s printer, with line numbers (or linenumbers with dots), free format (ie without line numbers, with comments, etc.). Also characters they use sometimes needs to be replaced manually in the editor (ie. E,-, /, *, ",", > at label, print append sign, Rv,..).
A good example with above issues to see is the Gerald's listing - see
Great when that listing format could be processed by the editor properly
P.
PS: and if it could generate a QR code as well, that would be nice!
05-04-2015, 05:27 AM
Post: #8
 Graan Member Posts: 65 Joined: Dec 2013
RE: 42s Code Editor - floats issue
Means some kind of pre formatting of pasted code since I think its better to distinguish this formatting from recognizing the code itself.
QR code im not familiar with. How much information can you get into a matrix?
Actually I dont know how people are using the editor so its good to get some feedback.

Had an idea to create some kind of graghic generator for the calculator.
You click in pixels on a graphic matrix and code will be created for the graphic. Might be useful.

Just have to get some time to look into this project again

/Andreas
05-05-2015, 04:09 PM (This post was last modified: 05-05-2015 04:12 PM by pito.)
Post: #9
 pito Member Posts: 127 Joined: Jun 2014
RE: 42s Code Editor - floats issue
(05-04-2015 05:27 AM)Graan Wrote:  QR code im not familiar with. How much information can you get into a matrix?
Actually I dont know how people are using the editor so its good to get some feedback.
The editor needs some refresh as there are minor issues - for example under windoze7 the window is not resizable here, etc. I can provide feedback when you find more time.
QR code - attached 89lines long prgm saved in .42s format.. (an example only)
You may try ie.
https://www.the-qrcode-generator.com/

Attached File(s) Thumbnail(s)

05-07-2015, 09:30 AM
Post: #10
 Graan Member Posts: 65 Joined: Dec 2013
RE: 42s Code Editor - floats issue
I implemented a code cleanup function and it will remove line numbers:
ex 12, 12. and 12>
Its now possible to use E in scientific notation and / (division) .
There are some cleanup for quotes , * and - as well.
I looked through some different code examples and found that there are so many styles to write the code and special characters etc so its not practical to convert all.

/Andreas
05-07-2015, 02:54 PM (This post was last modified: 05-07-2015 02:54 PM by Graan.)
Post: #11
 Graan Member Posts: 65 Joined: Dec 2013
RE: 42s Code Editor - floats issue
QR codes looks nice , but how do you import the .42s code to Free42 in a mobile phone?
05-07-2015, 07:26 PM (This post was last modified: 05-07-2015 09:52 PM by pito.)
Post: #12
 pito Member Posts: 127 Joined: Jun 2014
RE: 42s Code Editor - floats issue
Free42 needs a converter .42s->.raw built in, or a small app (the same as you do in your editor). For large programs you most probably would need several QR codes to merge..
The QR code version 40 - 177x177 modules can carry max 23648 databits (4296 alfanumeric chars) see http://www.qrcode.com/en/about/version.html
PS: we may convert .raw into Base64 an then to QR. That allows to handle bigger programs. We'll need Base64 import in the free42, however..
PS1: below stress.raw in Base64, 1276 chars stored (against 3961 chars of stress.42s prgm)

Attached File(s) Thumbnail(s)

05-08-2015, 04:41 AM (This post was last modified: 05-08-2015 04:45 AM by Graan.)
Post: #13
 Graan Member Posts: 65 Joined: Dec 2013
RE: 42s Code Editor - floats issue
What about using binary mode (about 2k of data) for the QR code and converting a .raw file? Then you have to save the result in the mobile to a .raw file. Dont know how the text is handled by the QR app however?
Im trying a QR code component in my editor and it works , only issue that its a trial version and the full verision is a bit costly.

You can send your mail address to me and I will send you the updated program. Mail address is in the Code Editor About box.

/Andreas
05-08-2015, 07:46 AM
Post: #14
 pito Member Posts: 127 Joined: Jun 2014
RE: 42s Code Editor - floats issue
The binary mode may work too, I did not find an online qr generator which does binary, though..
05-08-2015, 11:12 AM
Post: #15
 Graan Member Posts: 65 Joined: Dec 2013
RE: 42s Code Editor - floats issue
Binary mode seems to be useful if you develop your own mobile app and want to send custom data. Unfortunately Im not into mobile apps. Else I think that would be the way to go.
05-08-2015, 05:34 PM (This post was last modified: 05-08-2015 06:08 PM by pito.)
Post: #16
 pito Member Posts: 127 Joined: Jun 2014
RE: 42s Code Editor - floats issue
"E" works now, line numbers cleanup works too..
I would - make the window resizable (see below, we cannot see the complete hex then), remove excessive spaces before the command (when any) after the line number cutoff, and make a larger space between the line number and the command (too close optically). I would go with at least 4 digits long line number, though.
Great!

QR codes - that feature has to be supported by smartphone calc emulators, maybe the developers will consider. Let us see

Attached File(s) Thumbnail(s)

 « Next Oldest | Next Newest »

User(s) browsing this thread: 1 Guest(s)