 |
 |
Long Double only 64 bit?
|
 |
|
 |
|
Professional Poster
Join Date: Jul 2001
Location: Dis
Status:
Offline
|
|
Why is a long double the same length as a double? This is so stupid to me as to be pathetic. Yes, the compiler gives a warning that the long double could change in the future, but I needed 128 bit precision for a program in my Physics class (numerical model), and I had to use Maple to do it. I don't mind this so much, except for the fact that Maple is dog a$$ slow.
Does anybody know when or if Apple plans to fix this little problem?
BlackGriffen
|
|
I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forgo their use. -Galileo Galilei, physicist and astronomer (1564-1642)
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jul 2001
Location: Dis
Status:
Offline
|
|
I forgot to mention: I'm using standard C with Apples ProjectBuilder. I don't know C++, or I'd do it myself, Objective C, or Java. I hope to fix this later, but my concern is the logical inconsistency that a long double has the same length as the double.
BlackGriffen
|
|
I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forgo their use. -Galileo Galilei, physicist and astronomer (1564-1642)
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
It varies from processor to processor. On some processors, a short is the same length as an int. This is one of the inconsistencies in C.
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Jul 2001
Location: Dis
Status:
Offline
|
|
Originally posted by Detrius:
<STRONG>It varies from processor to processor. On some processors, a short is the same length as an int. This is one of the inconsistencies in C.</STRONG>
So will a long double on a G4 (I'm using a G3) be 128 bit?
Griff
|
|
I do not feel obliged to believe that the same God who has endowed us with sense, reason, and intellect has intended us to forgo their use. -Galileo Galilei, physicist and astronomer (1564-1642)
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Apr 2001
Location: Bethesda, MD
Status:
Offline
|
|
Originally posted by BlackGriffen:
<STRONG>
So will a long double on a G4 (I'm using a G3) be 128 bit?
Griff</STRONG>
Nope, because a program runs the same on a G3 as a G4 (except for Altivec). It's 64 bits, because thats the largest format floating point they both support. To do 128 bit FP, you'd have to do it in software.
Come to think of it, I don't know of any chip that does 128 bit FP in hardware. That could just be my ignorance, though.
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
Originally posted by davechen:
<STRONG>
Nope, because a program runs the same on a G3 as a G4 (except for Altivec). It's 64 bits, because thats the largest format floating point they both support. To do 128 bit FP, you'd have to do it in software.
Come to think of it, I don't know of any chip that does 128 bit FP in hardware. That could just be my ignorance, though.</STRONG>
If I remember correctly, the 68k processors had 80 bit FPU's (at least, the few that had FPUs). I remember because some of the stuff I did was less precise on my PPC than it was on my old-ass LC520. But of course, my PPC could do in a matter of minutes what it took that thing all night to do.
In theory, future implementations of AltiVec (G5) will support 128bit FP arithmetic.
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
|
 |
|
Dedicated MacNNer
Join Date: Apr 2001
Location: Bethesda, MD
Status:
Offline
|
|
Originally posted by Detrius:
<STRONG>
If I remember correctly, the 68k processors had 80 bit FPU's (at least, the few that had FPUs). I remember because some of the stuff I did was less precise on my PPC than it was on my old-ass LC520. But of course, my PPC could do in a matter of minutes what it took that thing all night to do.
In theory, future implementations of AltiVec (G5) will support 128bit FP arithmetic.</STRONG>
Yeah, I think a bunch of processors interally store FPs as 80 bits, but I don't know about being able to get those 80 bits. I could be just used interally to reduce error propogation.
As for the G5 altivec unit, I'd only heard about it possibly supporting regular double precisions floats (64 bit), since the current one only does 32 bit.
dave
|
|
|
| |
|
|
|
 |
|
 |
|
Professional Poster
Join Date: Apr 2001
Location: Long Beach, CA
Status:
Offline
|
|
Originally posted by davechen:
<STRONG>
Yeah, I think a bunch of processors interally store FPs as 80 bits, but I don't know about being able to get those 80 bits. I could be just used interally to reduce error propogation.
As for the G5 altivec unit, I'd only heard about it possibly supporting regular double precisions floats (64 bit), since the current one only does 32 bit.
dave</STRONG>
Oops. That's what I heard too. I'm getting my FP sizes mixed up. Sorry.
|

ACSA 10.4/10.3, ACTC 10.3, ACHDS 10.3
|
| |
|
|
|
 |
 |
|
 |
|
|
|
|
|

|
|
 |
Forum Rules
|
 |
 |
|
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
|
HTML code is Off
|
|
|
|
|
|
 |
 |
 |
 |
|
 |
|