What are the applications/benefits of an 80-bit extended precision data type?

前端 未结 5 870
故里飘歌
故里飘歌 2020-12-09 04:34

Yeah, I meant to say 80-bit. That\'s not a typo...

My experience with floating point variables has always involved 4-byte multiples, like singles (32 bit),

5条回答
  •  渐次进展
    2020-12-09 05:24

    Another advantage not yet mentioned for 80-bit types is that on 16-bit or 32-bit processors which don't have floating-point units but do have a "multiply" instruction which produces a result twice as long as the operands (16x16->32 or 32x32->64), arithmetic on a 64-bit mantissa subdivided into four or two 16-bit or 32-bit registers will be faster than arithmetic on a 53-bit mantissa which spans the same number of registers but has to share 12 register bits with the sign and exponent. For applications which don't need anything more precise than float, computations on a 48-bit "extended float" type could likewise be faster than computations on a 32-bit float.

    While some people might bemoan the double-rounding behavior of extended-precision types, that is realistically speaking only an issue in specialized applications requiring full bit-exact cross-platform reproducibility. From an accuracy standpoint, the difference between a rounding error of 64/128 vs 65/128, or 1024/2048ulp vs 1025/2048, is a non-issue; in languages with extended-precision variable types and consistent extended-precision semantics, use of extended types on many platforms without floating-point hardware (e.g. embedded systems) will offer both higher accuracy and better speed than single- or double-precision floating-point types.

提交回复
热议问题