473,549 Members | 2,746 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Minimum sizes of integral and floating point types

Is there any mentioning in the standard of the number of bits of the
various built in types, apart from char/signed char/unsigned char types?
Or only about the minimum value ranges of them?
Mar 8 '08 #1
13 2721
Ioannis Vranos wrote:
Is there any mentioning in the standard of the number of bits of the
various built in types, apart from char/signed char/unsigned char
types? Or only about the minimum value ranges of them?
It's actually in the C Standard. C++ Standard inherits those.

V
--
Please remove capital 'A's when replying by e-mail
I do not respond to top-posted replies, please don't ask
Mar 8 '08 #2
Victor Bazarov wrote:
Ioannis Vranos wrote:
>Is there any mentioning in the standard of the number of bits of the
various built in types, apart from char/signed char/unsigned char
types? Or only about the minimum value ranges of them?

It's actually in the C Standard. C++ Standard inherits those.

Yes, I knew that. Anyone with something more specific?
Mar 8 '08 #3
In article <fq***********@ ulysses.noc.ntu a.gr>,
iv*****@nospam. no.spamfreemail .gr says...
Victor Bazarov wrote:
Ioannis Vranos wrote:
Is there any mentioning in the standard of the number of bits of the
various built in types, apart from char/signed char/unsigned char
types? Or only about the minimum value ranges of them?
It's actually in the C Standard. C++ Standard inherits those.


Yes, I knew that. Anyone with something more specific?
Section 5.2.4.2

--
Later,
Jerry.

The universe is a figment of its own imagination.
Mar 9 '08 #4
Ioannis Vranos wrote:
Victor Bazarov wrote:
>Ioannis Vranos wrote:
>>Is there any mentioning in the standard of the number of bits of the
various built in types, apart from char/signed char/unsigned char
types? Or only about the minimum value ranges of them?

It's actually in the C Standard. C++ Standard inherits those.

Yes, I knew that. Anyone with something more specific?
You've already asked on c.l.c, why ask again here?

--
Ian Collins.
Mar 9 '08 #5
Jerry Coffin wrote:
In article <fq***********@ ulysses.noc.ntu a.gr>,
iv*****@nospam. no.spamfreemail .gr says...
>Victor Bazarov wrote:
>>Ioannis Vranos wrote:
Is there any mentioning in the standard of the number of bits of the
various built in types, apart from char/signed char/unsigned char
types? Or only about the minimum value ranges of them?
It's actually in the C Standard. C++ Standard inherits those.

Yes, I knew that. Anyone with something more specific?

Section 5.2.4.2

In C++03, section 5.2.4 is about "Pseudo destructor call". Nothing
relevant ro my question there.
Mar 9 '08 #6
Ian Collins wrote:
Ioannis Vranos wrote:
>Victor Bazarov wrote:
>>Ioannis Vranos wrote:
Is there any mentioning in the standard of the number of bits of the
various built in types, apart from char/signed char/unsigned char
types? Or only about the minimum value ranges of them?
It's actually in the C Standard. C++ Standard inherits those.
Yes, I knew that. Anyone with something more specific?

You've already asked on c.l.c, why ask again here?

Because I am interested in both C95 and C++03.
Mar 9 '08 #7
Ioannis Vranos wrote:
Ian Collins wrote:
>Ioannis Vranos wrote:
>>Victor Bazarov wrote:
Ioannis Vranos wrote:
Is there any mentioning in the standard of the number of bits of the
various built in types, apart from char/signed char/unsigned char
types? Or only about the minimum value ranges of them?
It's actually in the C Standard. C++ Standard inherits those.
Yes, I knew that. Anyone with something more specific?

You've already asked on c.l.c, why ask again here?


Because I am interested in both C95 and C++03.
C++ inherits this from C. The reference Jerry gave you was from the C
standard.

--
Ian Collins.
Mar 9 '08 #8
In article <fq**********@u lysses.noc.ntua .gr>,
iv*****@nospam. no.spamfreemail .gr says...
Jerry Coffin wrote:
In article <fq***********@ ulysses.noc.ntu a.gr>,
iv*****@nospam. no.spamfreemail .gr says...
Victor Bazarov wrote:
Ioannis Vranos wrote:
Is there any mentioning in the standard of the number of bits of the
various built in types, apart from char/signed char/unsigned char
types? Or only about the minimum value ranges of them?
It's actually in the C Standard. C++ Standard inherits those.

Yes, I knew that. Anyone with something more specific?
Section 5.2.4.2


In C++03, section 5.2.4 is about "Pseudo destructor call". Nothing
relevant ro my question there.
As noted above, the C standard is what's relevant here, so you need to
look at section 5.2.4.2 of the C standard (the C99 standard, to be
specific).

--
Later,
Jerry.

The universe is a figment of its own imagination.
Mar 9 '08 #9
On 8 mar, 23:09, Ioannis Vranos <ivra...@nospam .no.spamfreemai l.gr>
wrote:
Is there any mentioning in the standard of the number of bits
of the various built in types, apart from char/signed
char/unsigned char types? Or only about the minimum value
ranges of them?
No. But for integral types, the standard does impose a pure
binary representation, so the minimum value ranges do impose a
minimum number of bits. For floating point types, the standard
imposes minimum ranges and precision, which also imposes a
minimum amount of information present---if a "bit" is a binary
digit, this also imposes a certain minimum number of bits.

There's also a requirement that sizeof be an integral type, and
that you can examine all of the bits of an object (regardless of
its type) using unsigned char. Independently of the requirement
that CHAR_BIT be at least 8, this would forbid the usual PDP-10
organization of 36 bit words, with 5 7 bit bytes per word (and
one unused bit). It doesn't require that all bits participate
in the value representation, however---on a Unisys MCP, for
example, you can see all 48 bits of an int accessing it as an
array of [6] unsigned char, but only 40 participate in the value
representation, and only 39 can be accessed using unsigned int
with shift and masking operations.

--
James Kanze (GABI Software) email:ja******* **@gmail.com
Conseils en informatique orientée objet/
Beratung in objektorientier ter Datenverarbeitu ng
9 place Sémard, 78210 St.-Cyr-l'École, France, +33 (0)1 30 23 00 34

Mar 9 '08 #10

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

17
5336
by: Adam H. Peterson | last post by:
Is there a standard way to find the minimum value for a data type? I'm thinking along the lines of std::numeric_limits<T>::min(). But that doesn't work for floating point types. I can't use (-std::numeric_limits<T>::max()) either, because that won't work for unsigned types (and technically won't work for signed integer types and others...
14
2848
by: Mike Hewson | last post by:
Have been researching as to why: <example 1> class ABC { static const float some_float = 3.3f; }; <end example 1>
16
5104
by: TTroy | last post by:
Hello, I'm relatively new to C and have gone through more than 4 books on it. None mentioned anything about integral promotion, arithmetic conversion, value preserving and unsigned preserving. And K&R2 mentions "signed extension" everywhere. Reading some old clc posts, I've beginning to realize that these books are over-generalizing the...
8
316
by: Ioannis Vranos | last post by:
About C95. Is there any mentioning in the standard about the number of usable bits of the various built in types, apart from char/signed char/unsigned char types? Or only about the minimum value ranges of them?
2
3997
by: James Harris | last post by:
I'm trying to make sense of the standard C data sizes for floating point numbers. I guess the standards were written to accommodate some particular floating point engines that were popular at one time but I can only find references to the number of decimals etc. Basically, if I wanted to specify C-sized reals in a language that only accepted...
2
1676
by: Mihai Rusu | last post by:
Hello I am trying to figure out if the standard allows integral type representations with padding (ie value representation != object representation). A conforming implementation can have: - a 32bit int and 32bit unsigned int but have the unsigned int not use the sign bit for value representation? (so INT_MAX == UINT_MAX == 2^32-1) - a...
0
7524
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main...
0
7720
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. ...
1
7475
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For...
0
7812
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the...
1
5372
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes...
0
5089
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3483
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1944
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1061
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.