Why don't the authors of the C / C99 standard specify ... a standard value for floating point type types?

I noticed on windows and linux x86, float - 4 bytes, double - 8, but the long double - 12 and 16 on x86 and x86_64 respectively. It is anticipated that the C99 will break down such barriers with specific integrated dimensions.

The initial technological limitation seems to be due to the fact that the x86 processor is not able to handle more than 80 bits of floating operations (plus 2 bytes to round it), but why is there a discrepancy in the standard compared to int types? Why don't they go at least to 80-bit standardization?

+3
source share
3 answers

C , .

- C (, signed char - -127 127, short int -32,767 32,767, long - - 2,147,483,647 2,147,483,647, long long -9,223,372,036,854,775,807 9,223,372,036,854,775,807). , .

C99 , int32_t - - , .

(, double 10 ).

+5

( ) C, IEEE.

+3

int , , , , .. int , (= ). , , , .

floaton the other hand, it is a design for a very specific use (floating point arithmetic). You can hardly determine exactly how many bits you need for yours float. In fact, in most cases, the more bits you have, the better.

+1
source

Source: https://habr.com/ru/post/1758804/


All Articles