what languages expose IEEE 754 traps to the developer?

后端 未结 4 1040
天命终不由人
天命终不由人 2021-02-14 22:38

I\'d like to play with those traps for educational purpose.

A common problem with the default behavior in numerical calculus is that we \"miss\" the Nan (or +-inf) that

4条回答
  •  -上瘾入骨i
    2021-02-14 23:05

    C and probably most languages derived from it like C++ or python (may be indirect access though). It's probably reasonable to expect that low level languages will have such support.

    See http://www.math.utah.edu/~beebe/software/ieee/#c-notes which has numerous scripts and notes on working with IEEE 754 numbers. In particular of1.c deals with floating point exceptions. Finally, from the source http://grouper.ieee.org/groups/754/reading.html which includes a bunch of useful info.

提交回复
热议问题