Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

6
  • 9
    Microsoft X86 16 bit tool sets support 80 bit long doubles. This was dropped in their X86 32 bit and X86 64 bit tool sets. Win32s for WIndow 3.1 was released about the same time as NT 3.1. I'm not sure if Windows 3.1 winmem32 was released before or after win32s. Commented Apr 19, 2019 at 13:46
  • 3
    C89 botched "long double" by violating the fundamental principle that all floating-point values passed to non-prototyped functions get converted to a common type. If it had specified that values of long double get converted to double except when wrapped using a special macro which would pass them in a struct __wrapped_long_double, that would have avoided the need for something like printf("%10.4f", x*y); to care about the types of both x and y [since the value isn't wrapped, the value would get passed to double regardless of the types of x and y]. Commented Apr 19, 2019 at 21:37
  • 4
    IIRC Delphi 5 (and probably also 3,4,6, and 7) had the "Extended" type which used all 80 bits of the FPU registers. The generic "Real" type could be made an alias of that, of the 64-bit Double, or of a legacy Borland soft float format. Commented Apr 20, 2019 at 11:04
  • 2
    @MichaelKarcher: The introduction of long int came fairly late in the development of C, and caused considerable problems. Nonetheless, I think a fundamental difference between the relationship of long int and int, vs. long double and double, is that every value within the range of int can be represented just as accurately by that type as by any larger type. Thus, if scale_factor will never exceed the range of int, there would generally be no reason for it to be declared as a larger type. On the other hand, if one writes double one_tenth=0.1;, ... Commented Apr 20, 2019 at 16:23
  • 4
    ...and then computes double x=one_tenth*y;, the calculation may be less precise than if one had written double x=y/10.0; or used long double scale_factor=0.1lL. If neither wholeQuantity1 nor wholeQuantity2 would need to accommodate values outside the range of int, the expression wholeQuantity1+wholeQuantity2 will likely be of type int or unsigned. But in many cases involving floating-point, there would be some advantage to using longer-precision scale factors. Commented Apr 20, 2019 at 16:29