A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://mail.python.org/pipermail/python-dev/2000-November/010478.html below:

[Python-Dev] Revamping Python's Numeric Model

[Python-Dev] Revamping Python's Numeric Model [Python-Dev] Revamping Python's Numeric ModelMartin v. Loewis martin@loewis.home.cs.tu-berlin.de
Tue, 7 Nov 2000 01:49:34 +0100
> Is there some API for it in C?

In C99, you have access to the floating-point environment:

               #include <fenv.h>
               /* ... */
               {
                       #pragma STDC FENV_ACCESS ON
                       int set_excepts;
                       feclearexcept(FE_INEXACT | FE_OVERFLOW);
                       // maybe raise exceptions
                       set_excepts = fetestexcept(FE_INEXACT | FE_OVERFLOW);
                       if (set_excepts & FE_INEXACT) f();
                       if (set_excepts & FE_OVERFLOW) g();
                       /* ... */
               }

It defines the following symbolic exception constants:

               FE_DIVBYZERO
               FE_INEXACT
               FE_INVALID
               FE_OVERFLOW
               FE_UNDERFLOW

Few compilers support that, though.

Regards,
Martin



RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4