[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [avr-libc-dev] Math accuracy
From: |
Björn Haase |
Subject: |
Re: [avr-libc-dev] Math accuracy |
Date: |
Mon, 24 Apr 2006 00:21:24 +0200 |
User-agent: |
KMail/1.7.1 |
David Carr wrote on Montag, 24. April 2006 09:30 :
> Just for fun I ran the "savage" benchmark on my Mega16 at 6MHz. I
> attempted to use double precision everywhere. (I say attempted because
> I'm no expert at this.)
>
> A further test reveals (to me) that sizeof(float) == sizeof(double) == 4.
> Is there a way to have sizeof(double) == 8?
Yes:
You would have to write floating point emulation for 8-byte double IEEE
numbers. So far the only thing avr-libc is having is a FP emulation for
4-byte floats (that is IIRC not fully IEEE compliant).
Presently there is no difference concerning the code if you are writing
"double" or "float".
Bjoern.