diff options
author | mattip <matti.picus@gmail.com> | 2018-05-10 09:42:17 +0300 |
---|---|---|
committer | mattip <matti.picus@gmail.com> | 2018-05-10 09:42:17 +0300 |
commit | 1e00cc531007aa3418ad9deb7fbc5faaacce5795 (patch) | |
tree | d91a1a628429afc789c4d0553ad89c5bb168a400 /doc/source/reference | |
parent | f5758d6fe15c2b506290bfc5379a10027617b331 (diff) | |
download | numpy-1e00cc531007aa3418ad9deb7fbc5faaacce5795.tar.gz |
DOC: expand reasoning behind npy_*floatstatus_barrer()
Diffstat (limited to 'doc/source/reference')
-rw-r--r-- | doc/source/reference/c-api.coremath.rst | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/doc/source/reference/c-api.coremath.rst b/doc/source/reference/c-api.coremath.rst index 8f7686828..ad92235da 100644 --- a/doc/source/reference/c-api.coremath.rst +++ b/doc/source/reference/c-api.coremath.rst @@ -183,12 +183,19 @@ Those can be useful for precise floating point comparison. * NPY_FPE_UNDERFLOW * NPY_FPE_INVALID + Note that :c:func:`npy_get_floatstatus_barrier` is preferable as it prevents + agressive compiler optimizations reordering the call relative to + the code setting the status, which could lead to incorrect results. + .. versionadded:: 1.9.0 .. c:function:: int npy_get_floatstatus_barrier(char*) Get floating point status. A pointer to a local variable is passed in to - prevent aggresive compiler optimizations from reodering this function call. + prevent aggresive compiler optimizations from reodering this function call + relative to the code setting the status, which could lead to incorrect + results. + Returns a bitmask with following possible flags: * NPY_FPE_DIVIDEBYZERO @@ -202,9 +209,13 @@ Those can be useful for precise floating point comparison. Clears the floating point status. Returns the previous status mask. + Note that :c:func:`npy_clear_floatstatus_barrier` is preferable as it + prevents agressive compiler optimizations reordering the call relative to + the code setting the status, which could lead to incorrect results. + .. versionadded:: 1.9.0 -.. c:function:: int npy_clear_floatstatus(char*) +.. c:function:: int npy_clear_floatstatus_barrier(char*) Clears the floating point status. A pointer to a local variable is passed in to prevent aggresive compiler optimizations from reodering this function call. |