mrvan Posted August 6 Share Posted August 6 I've noted that the compiler doesn't generate float (double) literals correctly. Has anyone other than insomnia made any successful attempts at updating the GCC compiler or are we all running with frozen version? As far as I can tell insomnia has permanently left the building. I'm willing to take a go at it at some point, being a fairly low priority. But if someone else is maintaining the compiler in anyway I will happily request help from that person. I pretty much have all the double math and conversion methods complete, including those that the GCC compiler calls when substituting operators. The descriptions and examples of radix 100 are unfortunately incorrect, possibly being the root cause of the compiler's incorrect implementation. From https://www.unige.ch/medecine/nouspikel/ti99/reals.htm: exponent mantissa decimal >40 >01 >02 >03 >04 >05 >06 >07 1.020304050607 correct >41 >01 >02 >03 >04 >05 >06 >0B 10.20304050611 incorrect -- notice that the exponent is 41, thus the number must be >= 100.0. This is mixed radix 10 and 100. The actual value is 10x that stated. >40 >10 >20 >30 >40 >50 >61 >10. 10.20304050611 correct These TI tech pages are rich with info and I've learned a lot from them. I suspect this has gone relatively unnoticed since the use for doubles is quite limited--its not as if we're all out there developing scientific applications, and generally most math going on is probably integer-based. Much of my current project is developing C libraries, usually those included in libc, at least the more commonly used, and the floating point support is just part of completing the missing aspects. Quote Link to comment Share on other sites More sharing options...
+Lee Stewart Posted August 6 Share Posted August 6 1 hour ago, mrvan said: >40 >10 >20 >30 >40 >50 >61 >10. 10.20304050611 correct Actually, for your example hex to match the floating point decimal number following it, the hex should be >40 >0A >14 >1E >28 >32 >3D >0A ...lee 3 Quote Link to comment Share on other sites More sharing options...
mrvan Posted August 6 Share Posted August 6 1 hour ago, Lee Stewart said: Actually, for your example hex to match the floating point decimal number following it, the hex should be >40 >0A >14 >1E >28 >32 >3D >0A ...lee LOL, yes, you are right! Just goes to show the challenge of radix 100 on my brain. 2 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.