NCEPLIBS-g2  3.5.0
intmath Module Reference

Define math functions used by compack(), simpack(), and misspack(). More...

Data Types

interface  i1log2
 
interface  ilog2
 

Functions/Subroutines

integer(kind=1) function i1log2_1 (ival)
 This function returns log(x+1)/log(2) unless x=maxint, in which case log(x)/log(2) for 1 bit integer numbers. More...
 
integer(kind=2) function i1log2_2 (ival)
 This function returns log(x+1)/log(2) unless x=maxint, in which case log(x)/log(2) for 2 bit integer numbers. More...
 
integer(kind=4) function i1log2_4 (ival)
 This function returns log(x+1)/log(2) unless x=maxint, in which case log(x)/log(2) for 4 bit integer numbers. More...
 
integer(kind=8) function i1log2_8 (ival)
 This function returns log(x+1)/log(2) unless x=maxint, in which case log(x)/log(2) for 8 bit integer numbers. More...
 
integer(kind=1) function ilog2_1 (i_in)
 This function returns log(x)/log(2) for 1 bit integer numbers. More...
 
integer(kind=2) function ilog2_2 (i_in)
 This function returns log(x)/log(2) for 2 bit integer numbers. More...
 
integer(kind=4) function ilog2_4 (i_in)
 This function returns log(x)/log(2) for 4 bit integer numbers. More...
 
integer(kind=8) function ilog2_8 (i_in)
 This function returns log(x)/log(2) for 8 bit integer numbers. More...
 

Detailed Description

Define math functions used by compack(), simpack(), and misspack().

This module includes the following functions:

  • ilog2 Calculate log(x)/log(2).
    • ilog2_8 for 8 bit integer numbers.
    • ilog2_4 for 4 bit integer numbers.
    • ilog2_2 for 2 bit integer numbers.
    • ilog2_1 for 1 bit integer numbers.
  • i1log2 Calculate log(x+1)/log(2) unless x=maxint, in which case log(x)/log(2).
    • i1log2_8 for 8 bit integer numbers.
    • i1log2_4 for 4 bit integer numbers.
    • i1log2_2 for 2 bit integer numbers.
    • i1log2_1 for 1 bit integer numbers.
Author
Stephen Gilbert
Date
2000-06-21

Function/Subroutine Documentation

◆ i1log2_1()

integer(kind=1) function intmath::i1log2_1 ( integer(kind=1), value  ival)

This function returns log(x+1)/log(2) unless x=maxint, in which case log(x)/log(2) for 1 bit integer numbers.

Parameters
[in]ival1 bit integer numbers.
Returns
value for log(x+1)/log(2)
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 99 of file intmath.F90.

Referenced by intmath::i1log2::i1log2_1().

◆ i1log2_2()

integer(kind=2) function intmath::i1log2_2 ( integer(kind=2), value  ival)

This function returns log(x+1)/log(2) unless x=maxint, in which case log(x)/log(2) for 2 bit integer numbers.

Parameters
[in]ival2 bit integer numbers.
Returns
value for log(x+1)/log(2)
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 82 of file intmath.F90.

Referenced by intmath::i1log2::i1log2_2().

◆ i1log2_4()

integer(kind=4) function intmath::i1log2_4 ( integer(kind=4), value  ival)

This function returns log(x+1)/log(2) unless x=maxint, in which case log(x)/log(2) for 4 bit integer numbers.

Parameters
[in]ival4 bit integer numbers.
Returns
value for log(x+1)/log(2)
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 65 of file intmath.F90.

Referenced by intmath::i1log2::i1log2_4().

◆ i1log2_8()

integer(kind=8) function intmath::i1log2_8 ( integer(kind=8), value  ival)

This function returns log(x+1)/log(2) unless x=maxint, in which case log(x)/log(2) for 8 bit integer numbers.

Parameters
[in]ival8 bit integer numbers.
Returns
value for log(x+1)/log(2)
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 48 of file intmath.F90.

Referenced by intmath::i1log2::i1log2_8().

◆ ilog2_1()

integer(kind=1) function intmath::ilog2_1 ( integer(kind=1), value  i_in)

This function returns log(x)/log(2) for 1 bit integer numbers.

Parameters
[in]i_in1 bit integer numbers.
Returns
value for log(x)/log(2)
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 241 of file intmath.F90.

Referenced by intmath::i1log2::i1log2_1(), and intmath::ilog2::ilog2_1().

◆ ilog2_2()

integer(kind=2) function intmath::ilog2_2 ( integer(kind=2), value  i_in)

This function returns log(x)/log(2) for 2 bit integer numbers.

Parameters
[in]i_in2 bit integer numbers.
Returns
value for log(x)/log(2)
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 204 of file intmath.F90.

Referenced by intmath::i1log2::i1log2_2(), and intmath::ilog2::ilog2_2().

◆ ilog2_4()

integer(kind=4) function intmath::ilog2_4 ( integer(kind=4), value  i_in)

This function returns log(x)/log(2) for 4 bit integer numbers.

Parameters
[in]i_in4 bit integer numbers.
Returns
value for log(x)/log(2)
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 162 of file intmath.F90.

Referenced by intmath::i1log2::i1log2_4(), and intmath::ilog2::ilog2_4().

◆ ilog2_8()

integer(kind=8) function intmath::ilog2_8 ( integer(kind=8), value  i_in)

This function returns log(x)/log(2) for 8 bit integer numbers.

Parameters
[in]i_in8 bit integer numbers.
Returns
value for log(x)/log(2)
Author
Stephen Gilbert
Date
2000-06-21

Definition at line 115 of file intmath.F90.

Referenced by intmath::i1log2::i1log2_8(), and intmath::ilog2::ilog2_8().