Define LDBL_MAX/MIN on C

前端 未结 3 1766
猫巷女王i
猫巷女王i 2021-01-16 07:41

I\'m working with C, I have to do an exercise in which I have to print the value of long double min and long double max.

I used float

3条回答
  •  庸人自扰
    2021-01-16 08:04

    From this reference on the lfoating point types:

    long double - extended precision floating point type. Matches IEEE-754 extended floating-point type if supported, otherwise matches some non-standard extended floating-point type as long as its precision is better than double and range is at least as good as double, otherwise matches the type double. Some x86 and x86_64 implementations use the 80-bit x87 floating point type.

    Added emphasis is mine.

    What the above quote says is that while a compliant C compiler must have the long double type, it doesn't really have to support it differently than double. Something which is probably the case with the Visual Studio C compiler.

提交回复
热议问题