[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 1


fp_invalid_op, fp_divbyzero, fp_overflow, fp_underflow, fp_inexact, fp_any_xcp Subroutine

Purpose

Tests to see if a floating-point exception has occurred.

Library

Standard C Library (libc.a)

Syntax

#include <float.h>
#include <fpxcp.h>

int 
fp_invalid_op() 
int fp_divbyzero()

int fp_overflow() 
int fp_underflow()

int 
fp_inexact()
int fp_any_xcp()

Description

These subroutines aid in determining when an exception has occurred and the exception type. These subroutines can be called explicitly after blocks of code that may cause a floating-point exception.

Return Values

The fp_invalid_op subroutine returns a value of 1 if a floating-point invalid-operation exception status flag is set. Otherwise, a value of 0 is returned.

The fp_divbyzero subroutine returns a value of 1 if a floating-point divide-by-zero exception status flag is set. Otherwise, a value of 0 is returned.

The fp_overflow subroutine returns a value of 1 if a floating-point overflow exception status flag is set. Otherwise, a value of 0 is returned.

The fp_underflow subroutine returns a value of 1 if a floating-point underflow exception status flag is set. Otherwise, a value of 0 is returned.

The fp_inexact subroutine returns a value of 1 if a floating-point inexact exception status flag is set. Otherwise, a value of 0 is returned.

The fp_any_xcp subroutine returns a value of 1 if a floating-point invalid operation, divide-by-zero, overflow, underflow, or inexact exception status flag is set. Otherwise, a value of 0 is returned.

Implementation Specifics

These subroutines are part of Base Operating System (BOS) Runtime.

Related Information

The fp_any_enable, fp_is_enabled, fp_enable_all, fp_enable fp_disable_all, or fp_disable (fp_any_enable, fp_is_enabled, fp_enable_all, fp_enable, fp_disable_all, or fp_disable Subroutine) subroutine, fp_clr_flag, fp_read_flag, fp_set_flag, or fp_swap_flag (fp_clr_flag, fp_set_flag, fp_read_flag, or fp_swap_flag Subroutine) subroutine, fp_read_rnd or fp_swap_rnd (fp_read_rnd or fp_swap_rnd Subroutine) subroutine.

Floating-Point Processor Overview in POWERstation and POWERserver Hardware Technical Information-General Architectures.

Floating-Poin t Exceptions Overview and Subroutines Overview in AIX 5L Version 5.1 General Programming Concepts: Writing and Debugging Programs.


[ Previous | Next | Table of Contents | Index | Library Home | Legal | Search ]