I was looking to watch if there is any standard type similar to uint32_t which constantly would map into a 32-bit unsigned integral type but I can not discover any.

You are watching: How many bytes in a double

Is the dimension of float always 4 byte on all platform?Is the dimension of dual always 8?

Does either typical say anything on the matter?

I want to make certain that my dimension is always the same on every platforms (x86 and x64) so i am using standard int types, yet I might not find any similar typedef for float and double.



Excerpt native the C99 standard, normative annex F (The C++-standard does not explicitly point out this annex, though it consists of all affected functions without readjust per reference. Also, the varieties have to match for compatibility.):

IEC 60559 floating-point arithmetic

F.1 Introduction

1 This annex states C language assistance for the IEC 60559 floating-point standard. The IEC 60559 floating-point conventional is specifically Binary floating-point arithmetic because that microprocessor systems, 2nd edition (IEC 60559:1989), previously designated IEC 559:1989 and as IEEE conventional for Binary Floating-Point Arithmetic (ANSI/IEEE 754−1985). IEEE typical for Radix-Independent Floating-Point Arithmetic (ANSI/IEEE 854−1987) generalizes the binary standard to remove dependencies ~ above radix and also word length. IEC 60559 generally refers to the floating-point standard, as in IEC 60559 operation, IEC 60559 format, etc. An implementation that defines __STDC_IEC_559__ chandelier conform to the specifications in this annex.356) whereby a binding between the C language and IEC 60559 is indicated, the IEC 60559-specified habits is embraced by reference, unless proclaimed otherwise. Since an adverse and optimistic infinity space representable in IEC 60559 formats, all genuine numbers lie within the variety of representable values.

So, incorporate (or in C++ maybe ), and test for __STDC_IEC_559__.

If the macro is defined, not only are the types far better specified (float being 32bits and dual being 64bits among others), but likewise the behavior of builtin operators and also standard-functions is an ext specified.Lack the the macro does no give any guarantees.

See more: Concrete Weight Of 1 Yard Of Concrete, How Much Does A Yard Of Concrete Weigh

For x86 and x86_64 (amd64), you have the right to rely on the species float and twin being IEC-60559-conformant, though attributes using them and also operations ~ above them can not be.