Your Browser is not longer supported

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

{{viewport.spaceProperty.prod}}

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

&pagelevel(4)&pagelevel

Syntax

#include <ieee_390.h>

double ieee2double (double num);

Description

ieee2double() converts an 8-byte floating-point number num in /390 format to IEEE format and returns it as the result. There is no loss of precision.

Return val.

8-byte floating-point number in /390 format (in the event of success).

0.0

if the IEEE floating-point number is smaller than the smallest number that can be represented in /390 format or if NaN or inf is passed as a parameter.

If the IEEE floating-point number is greater than the largest number that can be represented in /390 format, this largest representable number is returned with the corresponding sign.

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 IEEE floating-point number is greater than the largest number that can be represented in /390 format, float_flag_overflow is set.
If the IEEE floating-point number is smaller than the smallest number that can be represented in /390 format, float_flag_underflow is set.
If NaN or inf is passed as a parameter, float_flag_invalid is set.

 See also

float2ieee(), double2ieee (), ieee2float().