Welcome to the MacNN Forums.

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

You are here: MacNN Forums > Software - Troubleshooting and Discussion > Developer Center > Long Double only 64 bit?

Long Double only 64 bit?
Thread Tools
Professional Poster
Join Date: Jul 2001
Location: Dis
Status: Offline
Reply With Quote
Apr 10, 2002, 09:19 PM
 
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
Reply With Quote
Apr 10, 2002, 09:23 PM
 
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
Reply With Quote
Apr 10, 2002, 10:22 PM
 
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
Reply With Quote
Apr 11, 2002, 02:19 AM
 
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
Reply With Quote
Apr 11, 2002, 12:27 PM
 
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
Reply With Quote
Apr 11, 2002, 03:13 PM
 
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
Reply With Quote
Apr 12, 2002, 03:34 PM
 
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
Reply With Quote
Apr 13, 2002, 01:17 AM
 
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
     
   
Thread Tools
Forum Links
Forum Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Top
Privacy Policy
All times are GMT -5. The time now is 09:43 AM.
All contents of these forums © 1995-2011 MacNN. All rights reserved.
Branding + Design: www.gesamtbild.com
vBulletin v.3.8.7 © 2000-2011, Jelsoft Enterprises Ltd., Content Relevant URLs by vBSEO 3.3.2