-
Notifications
You must be signed in to change notification settings - Fork 25
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Fix for procedure Expo in module Reals #42
Comments
There are loads of problems with real handling because of invalid size It happens by chance that I had already looked at this and committed the
Sorry - you must have just missed it :-(. It's a simpler solution - would you mind trying it with your test? There are so many issues with real across many, many library sources, I'm working on fixed integer types which will make coding the real Thanks -- Dave. On 2016-08-29 16:30, Артур Ефимов wrote:
Links:[1] |
Hi Dave, Yes, I must have missed the update. I've checked your solution with my test Sidenote: Just curious, what do you think about removing parentheses from Arthur 2016-08-29 20:30 GMT+03:00 David C W Brown notifications@github.com:
|
Good question. I feel more comfortable with the parentheses. Using C/C++ I became accustomed to adding technically redundant parentheses to avoid finding yet again that C's rules had surprised me. However I have just looked back to code I was writing in 1993 when I was happily using Modula-2 and yet to be adulterated by C, and found this:
So perhaps I shouldn't blame C. |
On my Debian 32 bit, procedure
Reals.Expo
(forREAL
) didn't work right, whereasExpoL
(forLONGREAL
) did work. As a result,Texts.WriteReal
andTexts.WriteRealFix
did not work (Texts.WriteLongReal
did work).I went ahead and fixed it (in
src/library/v4/Reals.Mod
):Before that it was just this:
And probably the issue had something to do with the incorrect work of
SYSTEM.VAL
forREAL
toINTEGER
conversion.P.S. Not sure if
SIZE(INTEGER) = 4
is required, but I added it for the future. The optimization removes the IF statement during compilation anyway.I used the graphic over here for reference and this simple test program:
The text was updated successfully, but these errors were encountered: