How C Handle Value Larger than 32 bit? 
Author Message
 How C Handle Value Larger than 32 bit?

Hi all,
I am programming with C for a few months. I have two questions regarded
as to how to handle value larger than 32 bit.
1/ Is there a datatype in C running on a Sun Solaris platform that can hold,
   let's say 64 bit?
2/ If it's not, then how could we handle such large value, let's say a value
   that has 50 bit value?

Could someone shed some light on this issue?
Thanks a lot in advance,

Ginger



Thu, 12 Feb 2004 14:01:42 GMT  
 How C Handle Value Larger than 32 bit?

Quote:
> Hi all,
> I am programming with C for a few months. I have two questions regarded
> as to how to handle value larger than 32 bit.
> 1/ Is there a datatype in C running on a Sun Solaris platform that can
hold,
>    let's say 64 bit?

That depends, is their a compilier for Solaris that implements the C99
standard? (If yes, see question 1.4)

Quote:
> 2/ If it's not, then how could we handle such large value, let's say a
value
>    that has 50 bit value?

With a bignum library.

Allow me to point you to this wonderful little thing called the FAQ, located
at http://www.eskimo.com/~scs/C-faq/top.html

Mark Duell



Thu, 12 Feb 2004 14:44:50 GMT  
 How C Handle Value Larger than 32 bit?

Quote:

> I am programming with C for a few months. I have two questions regarded
> as to how to handle value larger than 32 bit.
> 1/ Is there a datatype in C running on a Sun Solaris platform that can hold,
>    let's say 64 bit?

Ginger...

The last time I was on a Solaris system, the C compiler supported long long at
64bits (but the SunOS C compiler did not).
--
Morris Dovey
West Des Moines, Iowa USA



Thu, 12 Feb 2004 20:15:04 GMT  
 How C Handle Value Larger than 32 bit?

Quote:
>I am programming with C for a few months. I have two questions regarded
>as to how to handle value larger than 32 bit.
>1/ Is there a datatype in C running on a Sun Solaris platform that can hold,
>   let's say 64 bit?

C89 provides no integer type that is guaranteed to be wider than 32 bit.
C99 provides the type long long that is guaranteed to be at least 64-bit
wide.

The Sun Solaris C89 compiler supports long long as an extension.

Dan
--
Dan Pop
CERN, IT Division

Mail:  CERN - IT, Bat. 31 1-014, CH-1211 Geneve 23, Switzerland



Fri, 13 Feb 2004 01:04:20 GMT  
 How C Handle Value Larger than 32 bit?
Quote:

> Hi all,
> I am programming with C for a few months. I have two questions regarded
> as to how to handle value larger than 32 bit.
> 1/ Is there a datatype in C running on a Sun Solaris platform that can hold,
>    let's say 64 bit?
> 2/ If it's not, then how could we handle such large value, let's say a value
>    that has 50 bit value?

Type double is 64 bits and has 53 bits of mantissa meaning it can hold
integers precisely up to +- 2**53-1.

You could have gcc installed on the Sun box.  gcc has 'long long' 64-bit
integers.
--

"Everything should be made as simple as possible, but not simpler."
                    --- Albert Einstein ---



Sat, 14 Feb 2004 06:29:38 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. masking 1,2,4,8,16 bit values from 32 bit int

2. Get Nth bit value from a 32-bit number

3. how to write and read two 16 bit values into one 32 bit

4. 32-bit VC 2.2 DLLs with 32-bit VB4

5. top 32 bits of 64-bit product of two 32-bit integers

6. Linking 32 bit VC++4.2 DLLs with VB4.0 32 bit

7. Set/Extract right 24 bits of 32 bit value

8. 32 bit Icons and C# VS.net (24 bit + 8 bit alpha)

9. looking for >32-bit address space [and how will C handle it]

10. signed 64bit (aka 32:32 bit) pseudo division and multiplication

11. 32-bit parallel crc-32 gen/chk with padding bytes

12. Loading a 32-Bit DLL into a 16-Bit DLL

 

 
Powered by phpBB® Forum Software