Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

float2ieee - Convert floating-point number from /390 format to IEEE format (BS2000)

&pagelevel(4)&pagelevel

Syntax

#include <ieee_390.h>

float float2ieee (float num);

Description

float2ieee() converts a 4-byte floating-point number in /390 format to IEEE format and returns it as the result. There is no loss of precision.

Return val.

4 byte floating-point number in IEEE format (in the event of success).

+/- Infinity

if the /390 floating-point number is greater than the largest IEEE floating-point number that can be represented.

0.0

if the /390 floating-point number is smaller than the smallest IEEE floating-point number that can be represented.

The global variable float_exceptions_flag contains information for the event of unsuccessful conversion and is defined as follows:

extern int float_exception_flags;
enum { 
   float_flag_inexact   =  1,
   float_flag_divbyzero =  2, 
   float_flag_underflow =  4, 
   float_flag_overflow  =  8, 
   float_flag_invalid   = 16 
};

If the /390 floating-point number is greater than the largest IEEE floating-point number that can be represented, float_flag_overflow is set.
If the /390 floating-point number is smaller than the smallest IEEE floating-point number that can be represented, float_flag_underflow is set.

 See also

ieee2float(), double2ieee(), ieee2double().