Forum     

Go Back   Digit Technology Discussion Forum > Software > Programming
Register FAQ Calendar Mark Forums Read

Programming The destination for developers - C, C++, Java, Python and the lot


Closed Thread
 
LinkBack Thread Tools Display Modes
Old 08-01-2008, 11:39 AM   #1 (permalink)
Simply a DIGITian
 
krishnandu.sarkar's Avatar
 
Join Date: Nov 2007
Location: Kolkata
Posts: 2,942
Question How To Calculate Range of Data Types in C


Hiiiiiiiiiiiiiii.............Can any1 tell me d process to calculate range of data types in c????

I mean INT allocates 2 bytes in memory...........n itz range in 16 bit compilor is frm -37628 to +37627.............now how these is calculated?????...................
__________________
  • Read The Forum RULES First.
  • Before PM'ing Or Asking Any Questions To Any Mod Read The FAQ's
  • Before Starting A New Thread Read The STICKY THREADS First
  • Before Participating In Bazaar Section Read The BAZAAR RULES
krishnandu.sarkar is online now  
Advertisements. Register and be a member of the community to get rid of them.
Advertisement

Old 08-01-2008, 05:56 PM   #2 (permalink)
Human Spambot
 
Join Date: Jan 2007
Location: Lat 28.38°N , Longt 77.13°E
Posts: 2,431
Default Re: How To Calculate Range of Data Types in C

Its -32768 to +32767
2 raised to power 16(16 bit sys)=65536, so it can have 65536 different integer values (32768+32767+1 for 0 =65536). Similarly for 32 bit, 2 raised to power 32 values can be there for integers
ThinkFree is offline  
Old 08-01-2008, 07:01 PM   #3 (permalink)
Wise Old Crow
 
blueshift's Avatar
 
Join Date: Apr 2005
Location: Inside the Pixel
Posts: 1,227
Default Re: How To Calculate Range of Data Types in C

The range values are defined in limits.h header file.
For displaying the range of INT data type, you can print the value of INT_MAX and INT_MIN macros defined in that header file.
__________________
http://twitter.com/blueshift155
blueshift is offline  
Closed Thread

Bookmarks

Thread Tools
Display Modes

Posting 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


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to Calculate Data transfer? bhoolkumehul QnA (read only) 2 09-12-2006 02:35 PM
How to calculate the FPS of a game? anilthomas26 Gamerz 5 25-06-2005 03:36 PM
How do we calculate the GHZ speed in AMD Godhatesusalllll CPU / Motherboards 10 07-04-2005 11:58 AM

 
Latest Threads
- by Charan
- by Sarath
- by clmlbx

Advertisement




All times are GMT +5.5. The time now is 12:47 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2012, vBulletin Solutions, Inc.

Search Engine Optimization by vBSEO 3.3.2