************************************************************************
*                               BEGIN                                  *
*                                                                      *
*             Definitions of NUM_ UNSIGNED WORD functions              *
*             -------------------------------------------              *
*                                                                      *
*                               BEGIN                                  *
************************************************************************
*
*    Authors :
*     R.F. Warren-Smith (DUVAD::RFWS)
*
*    History :
*     16-AUG-1988:  Original version (DUVAD::RFWS)
*    endhistory
*
 
 
****************************************************
*   Arithmetic between two UNSIGNED WORD numbers   *
****************************************************

 
*   Add.
      NUM_ADDUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_ITOUW(
     :                          NUM_UWTOI( NUM_ARGUW1 ) +
     :                          NUM_UWTOI( NUM_ARGUW2 ) )
 
*   Subtract.
      NUM_SUBUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_ITOUW(
     :                          NUM_UWTOI( NUM_ARGUW1 ) -
     :                          NUM_UWTOI( NUM_ARGUW2 ) )
 
*   Floating multiply.
      NUM_MULUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_ITOUW(
     :                          NUM_UWTOI( NUM_ARGUW1 ) *
     :                          NUM_UWTOI( NUM_ARGUW2 ) )
 
*   Floating divide.
      NUM_DIVUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_RTOUW(
     :                          NUM_UWTOR( NUM_ARGUW1 ) /
     :                          NUM_UWTOR( NUM_ARGUW2 ) )
 
*   Integer divide.
      NUM_IDVUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_ITOUW(
     :                          NUM_UWTOI( NUM_ARGUW1 ) /
     :                          NUM_UWTOI( NUM_ARGUW2 ) )
 
*   Raise to power.
      NUM_PWRUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_ITOUW(
     :                          NUM_UWTOI( NUM_ARGUW1 ) **
     :                          NUM_UWTOI( NUM_ARGUW2 ) )
 

 
********************************************************************
*   UNSIGNED WORD functions with a single UNSIGNED WORD argument   *
********************************************************************

 
*   Negate argument.
      NUM_NEGUW( NUM_ARGUW ) = NUM_ITOUW( - NUM_UWTOI( NUM_ARGUW ) )
 
*   Square root.
      NUM_SQRTUW( NUM_ARGUW ) = NUM_RTOW( SQRT(
     :                          NUM_UWTOR( NUM_ARGUW ) ) )
 
*   Natural logarithm (base e).
      NUM_LOGUW( NUM_ARGUW ) = NUM_RTOW( LOG(
     :                          NUM_UWTOR( NUM_ARGUW ) ) )
 
*   Common logarithm (base 10).
      NUM_LG10UW( NUM_ARGUW ) = NUM_RTOW( LOG10(
     :                          NUM_UWTOR( NUM_ARGUW ) ) )
 
*   Exponential function.
      NUM_EXPUW( NUM_ARGUW ) = NUM_RTOUW( EXP(
     :                          NUM_UWTOR( NUM_ARGUW ) ) )
 
*   Absolute (positive) value.
      NUM_ABSUW( NUM_ARGUW ) = NUM_ARGUW
 
*   Nearest integer.
      NUM_NINTUW( NUM_ARGUW ) = NUM_ARGUW
 
*   Truncation to integer.
      NUM_INTUW( NUM_ARGUW ) = NUM_ARGUW

 
 
***************************************************************
*  UNSIGNED WORD functions with two UNSIGNED WORD arguments   *
***************************************************************

 
*   Minimum of two numbers.
      NUM_MINUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_ITOUW( MIN(
     :                          NUM_UWTOI( NUM_ARGUW1 ),
     :                          NUM_UWTOI( NUM_ARGUW2 ) ) )
 
*   Maximum of two numbers.
      NUM_MAXUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_ITOUW( MAX(
     :                          NUM_UWTOI( NUM_ARGUW1 ),
     :                          NUM_UWTOI( NUM_ARGUW2 ) ) )
 
*   Fortran DIM (positive difference) function.
      NUM_DIMUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_ITOUW( DIM(
     :                          NUM_UWTOI( NUM_ARGUW1 ),
     :                          NUM_UWTOI( NUM_ARGUW2 ) ) )
 
*   Fortran MOD (remainder) function.
      NUM_MODUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_ITOUW( MOD(
     :                          NUM_UWTOI( NUM_ARGUW1 ),
     :                          NUM_UWTOI( NUM_ARGUW2 ) ) )
 
*   Fortran SIGN (transfer of sign) function.
      NUM_SIGNUW( NUM_ARGUW1, NUM_ARGUW2 ) = NUM_ARGUW1
 

 
*************************************************************
*   Logical functions comparing two UNSIGNED WORD numbers   *
*************************************************************

 
*   Equality.
      NUM_EQUW( NUM_ARGUW1, NUM_ARGUW2 ) =
     :                          NUM_ARGUW1 .EQ. NUM_ARGUW2
 
*   Inequality.
      NUM_NEUW( NUM_ARGUW1, NUM_ARGUW2 ) =
     :                          NUM_ARGUW1 .NE. NUM_ARGUW2
 
*   Greater than.
      NUM_GTUW( NUM_ARGUW1, NUM_ARGUW2 ) =
     :                          NUM_UWTOI( NUM_ARGUW1 ) .GT.
     :                          NUM_UWTOI( NUM_ARGUW2 )
 
*   Greater than or equal.
      NUM_GEUW( NUM_ARGUW1, NUM_ARGUW2 ) =
     :                          NUM_UWTOI( NUM_ARGUW1 ) .GE.
     :                          NUM_UWTOI( NUM_ARGUW2 )
 
*   Less than.
      NUM_LTUW( NUM_ARGUW1, NUM_ARGUW2 ) =
     :                          NUM_UWTOI( NUM_ARGUW1 ) .LT.
     :                          NUM_UWTOI( NUM_ARGUW2 )
 
*   Less than or equal.
      NUM_LEUW( NUM_ARGUW1, NUM_ARGUW2 ) =
     :                          NUM_UWTOI( NUM_ARGUW1 ) .LE.
     :                          NUM_UWTOI( NUM_ARGUW2 )
 

 
************************************************************************
*                               END                                    *
*                                                                      *
*             Definitions of NUM_ UNSIGNED WORD functions              *
*                                                                      *
*                               END                                    *
************************************************************************
