Re: is there an ieee handler in Linux?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 04/24/2010 10:30 AM, Andrew Haley wrote:
> On 04/23/2010 08:49 PM, reg@xxxxxxx wrote:
>> There must be a handler for ieee arithmetic errors under Linux for C and for 
>> Fortran,
>> but my search with man and google don't turn up anything.
>> Can someone point me at the correct subroutine names.
> 
> See fgetenv(3).
> 
> Here's an example for C.
> 
> Andrew.
> 
> 
> #define _GNU_SOURCE
> 
> #include <signal.h>
> #include <stdio.h>
> #include <math.h>
> #include <fenv.h>
> #include <stdlib.h>
> 
> static void
> sigfpe_handler(int signo)
> {
>   fprintf (stderr, "%s\n", __FUNCTION__);
>   exit (1);
> }
> 
> 
> void
> main()
> {
>   signal (SIGFPE, sigfpe_handler);
> 
>   feenableexcept (FE_NOMASK_ENV);

Sorry,

  feenableexcept (FE_ALL_EXCEPT);


> 
>   fprintf (stderr, "%g\n", 0.0e0/0.0e0);
> 
> }

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux