Improve precision of float numbers
|
04-12-2019, 06:22 PM
Post: #5
|
|||
|
|||
RE: Improve precision of float numbers
Thinking about it some more:
If you can fit something like bignum in your MCU, you have other options (I was thinking smaller, so the tiny routines in that paper were the first choice): DecNumber is the reference implementation for multi precision decimal, but it abuses malloc/free so it's not too friendly for small hardware. Mpdecimal is Python's implementation, I used it for newRPL for quite some time, it's more MCU friendly but there's no transcendentals. And finally, you could also use newRPLs decimal library (and I don't know why I didn't think of it before, being the author...oh, well), which only needs a static scratch area of memory, no dependencies at all, and it's a single file. Transcendental functions are already done and they are tableless (almost) so it's very MCU friendly. It's not documented very well but since it was designed as a drop-in replacement for mpdecimal, the API is very similar. You should take a look at all 3, I'm not sure what are the limitations on your hardware but if it fits, it's way better than starting from scratch. |
|||
« Next Oldest | Next Newest »
|
User(s) browsing this thread: 2 Guest(s)