
OpenVMS RTL General Purpose (OTS$) Manual
OTS$POWHJ_R3 (VAX Only)
On VAX systems, the Raise an HFloating Base to a Longword Exponent
routine raises an Hfloating base to a longword exponent.
Format
OTS$POWHJ_R3 Hfloatingpointbase ,longwordintegerexponent
RETURNS
OpenVMS usage: 
floating_point 
type: 
H_floating 
access: 
write only 
mechanism: 
by value 
Result of raising an Hfloating base to a longword 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.
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 exponent.
Description
OTS$POWHJ_R3 raises an Hfloating 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
Hfloatingpointbase is zero and
longwordintegerexponent is zero or negative, or if
the
Hfloatingpointbase is negative.

OTS$POWII
The Raise a Word Base to a Word Exponent routine raises a word base to
a word exponent.
Format
OTS$POWII wordintegerbase ,wordintegerexponent
RETURNS
OpenVMS usage: 
word_signed 
type: 
word (signed) 
access: 
write only 
mechanism: 
by value 
Result of raising a word base to a word exponent.
Arguments
wordintegerbase
OpenVMS usage: 
word_signed 
type: 
word (signed) 
access: 
read only 
mechanism: 
by value 
Base. The wordintegerbase argument is a signed word
containing the base.
wordintegerexponent
OpenVMS usage: 
word_signed 
type: 
word (signed) 
access: 
read only 
mechanism: 
by value 
Exponent. The wordintegerexponent argument is a
signed word containing the exponent.
Description
The OTS$POWII routine raises a word base to a word exponent.
On Alpha systems, some restrictions apply when linking OTS$POWII. See
Chapter 1 for more information about these restrictions.
Condition Values Signaled
SS$_FLTDIV

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

SS$_FLTOVF

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

MTH$_UNDEXP

Undefined exponentiation. This error is signaled if
wordintegerbase is zero and
wordintegerexponent is zero or negative, or if
wordintegerbase is negative.

OTS$POWJJ
The Raise a Longword Base to a Longword Exponent routine raises a
signed longword base to a signed longword exponent.
Format
OTS$POWJJ longwordintegerbase ,longwordintegerexponent
RETURNS
OpenVMS usage: 
longword_signed 
type: 
longword (signed) 
access: 
write only 
mechanism: 
by value 
Result of raising a signed longword base to a signed longword exponent.
Arguments
longwordintegerbase
OpenVMS usage: 
longword_signed 
type: 
longword (signed) 
access: 
read only 
mechanism: 
by value 
Base. The longwordintegerbase argument is a signed
longword 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 containing the exponent.
Description
The OTS$POWJJ routine raises a signed longword base to a signed
longword exponent.
On Alpha systems, some restrictions apply when linking OTS$POWJJ. See
Chapter 1 for more information about these restrictions.
Condition Values Signaled
SS$_FLTDIV

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

SS$_FLTOVF

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

MTH$_UNDEXP

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

OTS$POWLULU
The Raise an Unsigned Longword Base to an Unsigned Longword Exponent
routine raises an unsigned longword integer base to an unsigned
longword integer exponent.
Format
OTS$POWLULU unsignedlwordintbase, unsignedlwordintexponent
RETURNS
OpenVMS usage: 
longword_unsigned 
type: 
longword (unsigned) 
access: 
write only 
mechanism: 
by value 
Result of raising an unsigned longword integer base to an unsigned
longword integer exponent.
Arguments
unsignedlwordintbase
OpenVMS usage: 
longword_unsigned 
type: 
longword (unsigned) 
access: 
read only 
mechanism: 
by value 
Unsigned longword integer base. The
unsignedlwordintbase argument contains the value of
the integer base.
unsignedlwordintexponent
OpenVMS usage: 
longword_unsigned 
type: 
longword (unsigned) 
access: 
read only 
mechanism: 
by value 
Unsigned longword integer exponent. The
unsignedlwordintexponent argument contains the
value of the integer exponent.
Description
OTS$POWLULU returns the unsigned longword integer result of raising an
unsigned longword integer base to an unsigned longword integer
exponent. Note that overflow cannot occur in this routine. If the
result or intermediate result is greater than 32 bits, the loworder 32
bits are used.
On Alpha systems, some restrictions apply when linking OTS$POWLULU. See
Chapter 1 for more information about these restrictions.
Condition Values Signaled
MTH$_UNDEXP

Both the base and exponent values are zero.

OTS$POWRD
The Raise an FFloating Base to a DFloating Exponent routine raises an
Ffloating base to a Dfloating exponent.
Format
OTS$POWRD Ffloatingpointbase ,Dfloatingpointexponent
RETURNS
OpenVMS usage: 
floating_point 
type: 
D_floating 
access: 
write only 
mechanism: 
by value 
Result of raising an Ffloating base to a Dfloating exponent.
Arguments
Ffloatingpointbase
OpenVMS usage: 
floating_point 
type: 
F_floating 
access: 
read only 
mechanism: 
by value 
Base. The Ffloatingpointbase argument is an
Ffloating number containing the base.
Dfloatingpointexponent
OpenVMS usage: 
floating_point 
type: 
D_floating 
access: 
read only 
mechanism: 
by value 
Exponent. The Dfloatingpointexponent argument is a
Dfloating number that contains the exponent.
Description
OTS$POWRD raises an Ffloating base to a Dfloating exponent.
The internal calculations and the floatingpoint result have the same
precision as the base value.
OTS$POWRD first converts the Ffloating base to Dfloating. The
Dfloating result for OTS$POWRD 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
Ffloatingpointbase is zero and
Dfloatingpointexponent is zero or negative, or if
Ffloatingpointbase is negative.

Example

C+
C This Fortran example uses OTS$POWRD, to raise an Ffloating point
C base to a Dfloating point exponent. The result is a Dfloating value.
C
REAL*4 X
REAL*8 Y,RESULT,OTS$POWRD
INTEGER M(2)
EQUIVALENCE (M(1),Y)
X = 9768.0
Y = 9.0
C+
C The arguments of OTS$POWRD are passed by value.
C
RESULT = OTS$POWRD(%VAL(X),%VAL(M(1)),%VAL(M(2)))
TYPE *,' 9768.0**9.0 IS ',RESULT
X = 7689.0
Y = 0.587436654545
C+
C In Fortran, OTS$POWRD is indirectly called by the exponentiation operator.
C
RESULT = X**Y
TYPE *,' 7689.0**0.587436654545 IS ',RESULT
END

This Fortran example uses OTS$POWRD to raise an Ffloating base to a
Dfloating exponent. Notice the difference in the precision of the
result produced by this routine in comparison to the result produced by
OTS$POWRR. The output generated by this program is as follows:
9768.0**9.0 IS 8.0956338648832908E+35
7689.0**0.587436654545 IS 5.2155199252836588E03

OTS$POWRJ
The Raise an FFloating Base to a Longword Exponent routine raises an
Ffloating base to a longword exponent.
Format
OTS$POWRJ Ffloatingpointbase ,longwordintegerexponent
RETURNS
OpenVMS usage: 
floating_point 
type: 
F_floating 
access: 
write only 
mechanism: 
by value 
Result of raising an Ffloating base to a longword exponent.
Arguments
Ffloatingpointbase
OpenVMS usage: 
floating_point 
type: 
F_floating 
access: 
read only 
mechanism: 
by value 
Base. The Ffloatingpointbase argument is an
Ffloating 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 longword exponent.
Description
OTS$POWRJ raises an Ffloating 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$POWRJ. 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 exponentiation. This error is signaled if
Ffloatingpointbase is zero and
longwordintegerexponent is zero or negative, or if
Ffloatingpointbase is negative.

OTS$POWRR
The Raise an FFloating Base to an FFloating Exponent routine raises
an Ffloating base to an Ffloating exponent.
Format
OTS$POWRR Ffloatingpointbase ,Ffloatingpointexponent
RETURNS
OpenVMS usage: 
floating_point 
type: 
F_floating 
access: 
write only 
mechanism: 
by value 
Result of raising an Ffloating base to an Ffloating exponent.
Arguments
Ffloatingpointbase
OpenVMS usage: 
floating_point 
type: 
F_floating 
access: 
read only 
mechanism: 
by value 
Base. The Ffloatingpointbase argument is an
Ffloating 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$POWRR raises an Ffloating base to an Ffloating exponent.
The internal calculations and the floatingpoint result have the same
precision as the base value.
The Ffloating result for OTS$POWRR 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$POWRR. 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 exponentiation. This error is signaled if
Ffloatingpointbase is zero and
Ffloatingpointexponent is zero or negative, or if
Ffloatingpointbase is negative.

Example

C+
C This Fortran example demonstrates the use
C of OTS$POWRR, which raises an Ffloating
C point base to an Ffloating point power.
C
REAL*4 X,Y,RESULT,OTS$POWRR
X = 8.0
Y = 2.0
C+
C The arguments of OTS$POWRR are passed by value.
C
RESULT = OTS$POWRR(%VAL(X),%VAL(Y))
TYPE *,' 8.0**2.0 IS ',RESULT
X = 9.0
Y = 0.5
C+
C In Fortran, OTS$POWRR is indirectly called by simply
C using the exponentiation operator.
C
RESULT = X**Y
TYPE *,' 9.0**0.5 IS ',RESULT
END

This Fortran example uses OTS$POWRR to raise an Ffloating point base
to an Ffloating point exponent. The output generated by this program
is as follows:
8.0**2.0 IS 64.00000
9.0**0.5 IS 0.3333333

