OSDev.org

The Place to Start for Operating System Developers
It is currently Fri Apr 19, 2024 3:10 pm

All times are UTC - 6 hours




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: double type
PostPosted: Tue Oct 29, 2002 4:41 pm 
Hi,

I was wondering if the type 'double' is a special type or not, can I use this in my own OS without anything special?

thanks.


Top
  
 
 Post subject: Re:double type
PostPosted: Tue Oct 29, 2002 5:05 pm 
you mean hi dd 0?
you can do that if you use a extern long hi; if you use it in C.


Top
  
 
 Post subject: Re:double type
PostPosted: Tue Oct 29, 2002 5:56 pm 
this question is probably more suited to the OS Dev section...


Top
  
 
 Post subject: Re:double type
PostPosted: Tue Oct 29, 2002 8:35 pm 
Friend wrote:
I was wondering if the type 'double' is a special type or not, can I use this in my own OS without anything special?


That depends on a) the language you mean, b) the compiler or interpreter you are using, and c) how you've written you OS.

Assuming you mean the C/C++ 'double' type, and are compiling with gcc or some similar, then there shouldn't be a problem. The double type - usually implemented as 80-bit IEEE double precision floating point, IIRC - is a standard type in C and C++, and the compiler should generate the appropriate FPU code (or floating-point emulation if you aren't using the FPU for whatever reason). You may need to have certain CPU exception handlers in place ahead of time, but aside form that the OS shouldn't need to do much to support it.

For more information, try a few searches on a combination of keywords like
[tt]x86 FPU
double precision floating point
GNU compiler[/tt]

You may want to look up how your compiler actually implements floating point on the PC.


Top
  
 
 Post subject: Re:double type
PostPosted: Wed Oct 30, 2002 12:35 am 
no, the double type is a 64-bit IEEE double-precision float. a long double is the 80-bit IEEE extended-precision float.

sorry to make a harsh correction, i just don't like seeing information misrepresented. ;D


Top
  
 
 Post subject: Re:double type
PostPosted: Wed Oct 30, 2002 1:32 am 
Thank you, you are correct.


Top
  
 
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: Majestic-12 [Bot] and 88 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group