HUGE Function

Purpose

Returns the largest positive value allowable for a floating-point variable.

Syntax

HUGE(x)

Parameters

x is an expression of type FLOAT BINARY or FLOAT DECIMAL.

Description

HUGE returns a floating-point value that is the largest positive value x can have. It has the base, mode, and precision of x.

The HUGE built-in is not allowed during restricted expression evaluation.

Example

This example shows the IEEE FLOAT BINARY and FLOAT DECIMAL values returned for the HUGE built-in.

dcl d float bin (52);
dcl f float bin (23);

   d = huge(d);    /* 1.7976931348623157E+308 */
   f = huge(f) ;    /* 3.402823466E+38         */

/* Supported on Intel only */

dcl x float dec (34);
dcl y float dec (16);
dcl z float dec (7);

    x = huge(x);    /* 9.999999999999999999999999999999999E+6144 */
    y = huge(y);   /* 9.999999999999999E+0384 */
    z = huge(z);    /* 9.999999E+0096 */