ur_rna.Utilities

## Class MathUtil

- java.lang.Object
- - ur_rna.Utilities.MathUtil

-     public class MathUtil
      extends java.lang.Object

  Extended math functions.

- - ### Constructor Summary

    Constructors
    Constructor and Description
    `MathUtil()`

  - ### Method Summary

    All Methods Static Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `static double` | `log2(double value)` Returns the base 2 logarithm of a number.
    `static int` | `log2i(double value)` Returns the smallest integer x such that 2^x is greater than or equal to the specified value.
    `static double` | `pow2(double value)` Returns the smallest power of 2 greater than or equal to the specified value.
    `static int` | `pow2i(double value)` Returns the smallest power of 2 greater than or equal to the specified value.
    `static long` | `pow2L(double value)` Returns the smallest power of 2 greater than or equal to the specified value.

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### MathUtil

          public MathUtil()

  - ### Method Detail

    - #### log2

          public static double log2(double value)

      Returns the base 2 logarithm of a number. i.e. `log(value)/log(2)`

    - #### log2i

          public static int log2i(double value)

      Returns the smallest integer x such that 2^x is greater than or equal to the specified value. e.g. `Pow2(37)` returns 6 (because 2^6 is the smallest power of two greater than or equal to 37)
      Parameters:
        `value` -
      Returns:
        An integer that represents the exponent of the smallest power of two that is greater than or equal to the specified value.

    - #### pow2

          public static double pow2(double value)

      Returns the smallest power of 2 greater than or equal to the specified value. e.g. `Pow2(37)` returns 64 because 32 < 37 <= 64

    - #### pow2i

          public static int pow2i(double value)

      Returns the smallest power of 2 greater than or equal to the specified value. e.g. `Pow2(37)` returns 64, which is the smallest power of 2 greater than or equal to 37. Note: If the return value might exceed the range of an integer, then `pow2L(double)` or `pow2(double)` should be used instead.

    - #### pow2L

          public static long pow2L(double value)

      Returns the smallest power of 2 greater than or equal to the specified value. e.g. `Pow2(37)` returns 64, which is the smallest power of 2 greater than or equal to 37.