Post Reply 
Improve precision of float numbers
04-16-2019, 02:43 PM (This post was last modified: 04-16-2019 02:57 PM by Claudio L..)
Post: #10
RE: Improve precision of float numbers
(04-13-2019 09:43 AM)deetee Wrote:  Thanks for the lot of hints.

My next calculator has an OLED display (128x64), a small (16 keys) keyboard with a fast menu function.
The MCU is a ATMEGA32 (Arduino) which offers 28k (with USB) or 32k of flash memory. Till now I tried ATTIN85 projects but 8k is a too hard limit for RPN calculators with a broad spectre of funcionalities.

A first try of BigNumbers - which is an excellent library - cost me approx. 8k (for basic math). This seems to much for my ressources. I think that is similar to the char array suggestion of Druzyek.

But the newRPL decimal library gives hope. Unfortunately I don't know how to extract this library from the 19MB-exe-file and how to involve it to my C-program (Arduino IDE). As I like "all in one source code files" it would be ideally for me to invoke C-subprograms. Sorry for my inflexibility and less experience.


I think none of the libraries I mentioned will fit in your flash or ram, I thought you had one of the bigger MCUs.

EDIT: By the way, you don't extract the library from the executable. You go to the sources section and look for decimal.c and decimal.h inside the newrpl folder. If you want transcendentals (which are unlikely to fit in your flash, but if you choose a newer AtMega32 with more flash...) look for lighttranscend.c, there's also transcendentals.c but they use tables. Depending on how much precision you want, the tables will become huge. In contrast, lighttranscend.c has no tables (at the expense of performance), and only a few constants (which you should reduce to the number of digits you need to reduce space). The routines are quite low-level, for examples on how to use them (since they are not documented well) you may look at lib-66-transcendentals.c to see what parameters they need.
Find all posts by this user
Quote this message in a reply
Post Reply 

Messages In This Thread
RE: Improve precision of float numbers - Claudio L. - 04-16-2019 02:43 PM

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