
OpenVMS RTL General Purpose (OTS$) Manual
OTS$POWDJ
The Raise a DFloating Base to a Longword Exponent routine raises a
Dfloating base to a longword exponent.
Format
OTS$POWDJ Dfloatingpointbase ,longwordintegerexponent
RETURNS
OpenVMS usage: 
floating_point 
type: 
D_floating 
access: 
write only 
mechanism: 
by value 
Result of raising a Dfloating base to a longword exponent.
Arguments
Dfloatingpointbase
OpenVMS usage: 
floating_point 
type: 
D_floating 
access: 
read only 
mechanism: 
by value 
Base. The Dfloatingpointbase argument is a
Dfloating number containing the base.
longwordintegerexponent
OpenVMS usage: 
longword_signed 
type: 
longword (signed) 
access: 
read only 
mechanism: 
by value 
Exponent. The longwordintegerexponent argument is a
signed longword that contains the signed longword integer exponent.
Description
OTS$POWDJ raises a Dfloating base to a longword exponent.
The internal calculations and the floatingpoint result have the same
precision as the base value.
The floatingpoint result is as follows:
Base 
Exponent 
Result 
Any

> 0

Product of (
base**2
^{
i
}
), where
i is each nonzero bit position in
longwordintegerexponent.

> 0

= 0

1.0

= 0

= 0

Undefined exponentiation.

< 0

= 0

1.0

> 0

< 0

1.0/(
base**2
^{
i
}
), where
i is each nonzero bit position in
longwordintegerexponent.

= 0

< 0

Undefined exponentiation.

< 0

< 0

1.0/(
base**2
^{
i
}
), where
i is each nonzero bit position in
longwordintegerexponent.

Floatingpoint overflow can occur.
Undefined exponentiation occurs if the base is zero and the exponent is
zero or negative.
Condition Values Signaled
SS$_FLTOVF

Arithmetic trap. This error is signaled by the hardware if a
floatingpoint overflow occurs.

MTH$_FLOOVEMAT

Floatingpoint overflow in math library.

MTH$_FLOUNDMAT

Floatingpoint underflow in math library.

MTH$_UNDEXP

Undefined exponentiation. This error is signaled if
Dfloatingpointbase is zero and
longwordintegerexponent is zero or negative, or if
the
Dfloatingpointbase is negative.

OTS$POWDR
The Raise a DFloating Base to an FFloating Exponent routine raises a
Dfloating base to an Ffloating exponent.
Format
OTS$POWDR Dfloatingpointbase ,Ffloatingpointexponent
RETURNS
OpenVMS usage: 
floating_point 
type: 
D_floating 
access: 
write only 
mechanism: 
by value 
Result of raising a Dfloating base to an Ffloating exponent.
Arguments
Dfloatingpointbase
OpenVMS usage: 
floating_point 
type: 
D_floating 
access: 
read only 
mechanism: 
by value 
Base. The Dfloatingpointbase argument is a
Dfloating number containing the base.
Ffloatingpointexponent
OpenVMS usage: 
floating_point 
type: 
F_floating 
access: 
read only 
mechanism: 
by value 
Exponent. The Ffloatingpointexponent argument is an
Ffloating number that contains the exponent.
Description
OTS$POWDR raises a Dfloating base to an Ffloating exponent.
The internal calculations and the floatingpoint result have the same
precision as the base value.
OTS$POWDR converts the Ffloating exponent to a Dfloating number. The
Dfloating result for OTS$POWDR is given by the following:
Base 
Exponent 
Result 
= 0

> 0

0.0

= 0

= 0

Undefined exponentiation

= 0

< 0

Undefined exponentiation

< 0

Any

Undefined exponentiation

> 0

> 0

2
^{[
exponent*log2 (
base)]
}

> 0

= 0

1.0

> 0

< 0

2
^{[
exponent*log2 (
base)]
}

Floatingpoint overflow can occur.
Undefined exponentiation occurs if the base is zero and the exponent is
zero or negative, or if the base is negative.
Condition Values Signaled
SS$_FLTOVF

Arithmetic trap. This error is signaled by the hardware if a
floatingpoint overflow occurs.

MTH$_FLOOVEMAT

Floatingpoint overflow in math library.

MTH$_FLOUNDMAT

Floatingpoint underflow in math library.

MTH$_UNDEXP

Undefined exponentiation. This error is signaled if
Dfloatingpointbase is zero and
Ffloatingpointexponent is zero or negative, or if
the
Dfloatingpointbase is negative.

OTS$POWGG
The Raise a GFloating Base to a GFloating Exponent routine raises a
Gfloating base to a Gfloating exponent.
Format
OTS$POWGG Gfloatingpointbase ,Gfloatingpointexponent
RETURNS
OpenVMS usage: 
floating_point 
type: 
G_floating 
access: 
write only 
mechanism: 
by value 
Result of raising a Gfloating base to a Gfloating exponent.
Arguments
Gfloatingpointbase
OpenVMS usage: 
floating_point 
type: 
G_floating 
access: 
read only 
mechanism: 
by value 
Base that OTS$POWGG raises to a Gfloating exponent. The
Gfloatingpointbase argument is a Gfloating number
containing the base.
Gfloatingpointexponent
OpenVMS usage: 
floating_point 
type: 
G_floating 
access: 
read only 
mechanism: 
by value 
Exponent to which OTS$POWGG raises the base. The
Gfloatingpointexponent argument is a Gfloating
number containing the exponent.
Description
OTS$POWGG raises a Gfloating base to a Gfloating exponent.
The internal calculations and the floatingpoint result have the same
precision as the base value.
The Gfloating result for OTS$POWGG is as follows:
Base 
Exponent 
Result 
= 0

> 0

0.0

= 0

= 0

Undefined exponentiation

= 0

< 0

Undefined exponentiation

< 0

Any

Undefined exponentiation

> 0

> 0

2
^{[
exponent*log2(
base)]
}

> 0

= 0

1.0

> 0

< 0

2
^{[
exponent*log2(
base)]
}

Floatingpoint overflow can occur.
Undefined exponentiation occurs if the base is zero and the exponent is
zero or negative, or if the base is negative.
On Alpha systems, some restrictions apply when linking OTS$POWGG. See
Chapter 1 for more information about these restrictions.
Condition Values Signaled
SS$_FLTOVF

Arithmetic trap. This error is signaled by the hardware if a
floatingpoint overflow occurs.

MTH$_FLOOVEMAT

Floatingpoint overflow in math library.

MTH$_FLOUNDMAT

Floatingpoint underflow in math library.

MTH$_UNDEXP

Undefined exponent. This error is signaled if
Gfloatingpointbase is zero and
Gfloatingpointexponent is zero or negative, or if
Gfloatingpointbase is negative.

Example

C+
C This example demonstrates the use of OTS$POWGG,
C which raises a Gfloating point base
C to a Gfloating point power.
C
REAL*8 X,Y,RESULT,OTS$POWGG
C+
C The arguments of OTS$POWGG are passed by value. Fortran can
C only pass INTEGER and REAL*4 expressions as VALUE. Since
C INTEGER and REAL*4 values are one longword long, while REAL*8
C values are two longwords long, equate the base (and power) to
C twodimensional INTEGER vectors. These vectors will be passed
C by VALUE.
C
INTEGER N(2),M(2)
EQUIVALENCE (N(1),X), (M(1),Y)
X = 8.0
Y = 2.0
C+
C To pass X by value, pass N(1) and N(2) by value. Similarly for Y.
C
RESULT = OTS$POWGG(%VAL(N(1)),%VAL(N(2)),%VAL(M(1)),%VAL(M(2)))
TYPE *,' 8.0**2.0 IS ',RESULT
X = 9.0
Y = 0.5
C+
C In Fortran, OTS$POWWGG is indirectly called by simply using the
C exponentiation operator.
C
RESULT = X**Y
TYPE *,' 9.0**0.5 IS ',RESULT
END

This Fortran example uses OTS$POWGG to raise a Gfloating base to a
Gfloating exponent.
The output generated by this example is as follows:
8.0**2.0 IS 64.0000000000000
9.0**0.5 IS 0.333333333333333

OTS$POWGJ
The Raise a GFloating Base to a Longword Exponent routine raises a
Gfloating base to a longword exponent.
Format
OTS$POWGJ Gfloatingpointbase ,longwordintegerexponent
RETURNS
OpenVMS usage: 
floating_point 
type: 
G_floating 
access: 
write only 
mechanism: 
by value 
Result of raising a Gfloating base to a longword exponent.
Arguments
Gfloatingpointbase
OpenVMS usage: 
floating_point 
type: 
G_floating 
access: 
read only 
mechanism: 
by value 
Base that OTS$POWGJ raises to a longword exponent. The
Gfloatingpointbase argument is a Gfloating number
containing the base.
longwordintegerexponent
OpenVMS usage: 
longword_signed 
type: 
longword (signed) 
access: 
read only 
mechanism: 
by value 
Exponent to which OTS$POWGJ raises the base. The
longwordintegerexponent argument is a signed
longword containing the exponent.
Description
OTS$POWGJ raises a Gfloating base to a longword exponent.
The internal calculations and the floatingpoint result have the same
precision as the base value.
The floatingpoint result is as follows:
Base 
Exponent 
Result 
Any

> 0

Product of (
base**2
^{
i
}
), where
i is each nonzero bit position in
longwordintegerexponent.

> 0

= 0

1.0

= 0

= 0

Undefined exponentiation.

< 0

= 0

1.0

> 0

< 0

1.0/(
base**2
^{
i
}
), where
i is each nonzero bit position in
longwordintegerexponent.

= 0

< 0

Undefined exponentiation.

< 0

< 0

1.0/(
base**2
^{
i
}
), where
i is each nonzero bit position in
longwordintegerexponent.

Floatingpoint overflow can occur.
Undefined exponentiation occurs if the base is zero and the exponent is
zero or negative.
On Alpha systems, some restrictions apply when linking OTS$POWGJ. See
Chapter 1 for more information about these restrictions.
Condition Values Signaled
SS$_FLTOVF

Arithmetic trap. This error is signaled by the hardware if a
floatingpoint overflow occurs.

MTH$_FLOOVEMAT

Floatingpoint overflow in math library.

MTH$_FLOUNDMAT

Floatingpoint underflow in math library.

MTH$_UNDEXP

Undefined exponent. This error is signaled if
Gfloatingpointbase is zero and
longwordintegerexponent is zero or negative, or if
Gfloatingpointbase is negative.

OTS$POWHH_R3 (VAX Only)
On VAX systems, the Raise an HFloating Base to an HFloating Exponent
routine raises an Hfloating base to an Hfloating exponent.
Format
OTS$POWHH_R3 Hfloatingpointbase ,Hfloatingpointexponent
RETURNS
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by value 
Result of raising an Hfloating base to an Hfloating exponent.
Arguments
Hfloatingpointbase
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by value 
Base. The Hfloatingpointbase argument is an
Hfloating number containing the base.
Hfloatingpointexponent
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
read only 
mechanism: 
by value 
Exponent. The Hfloatingpointexponent argument is an
Hfloating number that contains the Hfloating exponent.
Description
OTS$POWHH_R3 raises an Hfloating base to an Hfloating exponent.
The internal calculations and the floatingpoint result have the same
precision as the base value.
The Hfloating result for OTS$POWHH_R3 is as follows:
Base 
Exponent 
Result 
= 0

> 0

0.0

= 0

= 0

Undefined exponentiation

= 0

< 0

Undefined exponentiation

< 0

Any

Undefined exponentiation

> 0

> 0

2
^{[
exponent*log2(
base)]
}

> 0

= 0

1.0

> 0

< 0

2
^{[
exponent*log2(
base)]
}

Floatingpoint overflow can occur.
Undefined exponentiation occurs if the base is zero and the exponent is
zero or negative, or if the base is negative.
Condition Values Signaled
SS$_FLTOVF

Arithmetic trap. This error is signaled by the hardware if a
floatingpoint overflow occurs.

MTH$_FLOOVEMAT

Floatingpoint overflow in math library.

MTH$_FLOUNDMAT

Floatingpoint underflow in math library.

MTH$_UNDEXP

Undefined exponentiation. This error is signaled if
Hfloatingpointbase is zero and
Hfloatingpointexponent is zero or negative, or if
the
Hfloatingpointbase is negative.

Example

C+
C Example of OTS$POWHH, which raises an H_floating
C point base to an H_floating point power. In Fortran,
C it is not directly called.
C
REAL*16 X,Y,RESULT
X = 9877356535.0
Y = 0.5837653
C+
C In Fortran, OTS$POWWHH is indirectly called by simply using the
C exponentiation operator.
C
RESULT = X**Y
TYPE *,' 9877356535.0**0.5837653 IS ',RESULT
END

This Fortran example demonstrates how to call OTS$POWHH_R3 to raise an
Hfloating base to an Hfloating power.
The output generated by this program is as follows:
9877356535.0**0.5837653 IS 1.463779145994628357482343598205427E0006

