Float32 and UInt32?

18,676

Solution 1

UInt32 is a 32-bit (4-byte) unsigned integer. This means that it can represent values in the range
[0, 2^32-1] (= [0, 4294967295]).

Float32 is a 32-bit (aka single-precision [contrast with double-precision]) floating point number.


As other answers have mentioned, the types exist to guarantee the width.

Solution 2

The suffix gives the bit size. This makes them the same if and only if the Standard float and int have the same size on the target machine. They exist to give guaranteed sizes on all platforms.

Share:
18,676
Dixon Steel
Author by

Dixon Steel

Updated on August 14, 2022

Comments

  • Dixon Steel
    Dixon Steel over 1 year

    I am looking at some older Apple code for C++, I am familiar with float but not Float32 and Uint32 types are they the same as standard float and ints?

    Thanks