Post Reply 
Improve precision of float numbers
04-17-2019, 11:50 PM
Post: #14
RE: Improve precision of float numbers
(04-14-2019 05:56 AM)deetee Wrote:  Hi agarza!

(04-13-2019 02:03 PM)agarza Wrote:  What I did was to to use uint64_t (which gcc does support) and map it to a new float-64 type.
(see post: https://www.hpmuseum.org/forum/thread-12761.html)

Wow - thanks for this hint. I tried that before, but did not recognize that only Serial.Print doesn't support int64_t.

So my first attempt
Code:
struct real {
  long m;
  int8_t e;
};
can be changed to
Code:
struct real {
  int64_t m;
  int8_t e;
};
... and I can calculate with an (at least) 18 digit precision.

Can you tell me more how to "map it to a new float-64 type" - I didn't find a hint to it in your post?
Do I still have to reinvent mathematical functions?
How did you do it with your DIY calculator?

Regards deetee

PS: I like your DIY calculator - the front view, the custom PCB and how you managed to run the LCD display (I know these displays are really tricky to drive),

You can use Softfloat.

Their is a port of SoftFloat for the avr:
Float64

The gcc floating math libraries do not work on 64bit floats.
Try the 64 bit port for avr: Math64
Find all posts by this user
Quote this message in a reply
Post Reply 


Messages In This Thread
RE: Improve precision of float numbers - agarza - 04-17-2019 11:50 PM



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