Class UnsignedDouble

java.lang.Object
com.io7m.junsigned.core.UnsignedDouble

public final class UnsignedDouble extends Object
Functions to convert unsigned integer values to/from values of double.
  • Method Details

    • fromUnsignedInt

      public static double fromUnsignedInt(int x)
      Parameters:
      x - An unsigned integer value
      Returns:
      The given unsigned integer value as a double
    • toUnsignedInt

      public static int toUnsignedInt(double f)
      Parameters:
      f - A floating point value
      Returns:
      The given floating point value as an int
    • fromUnsignedLong

      public static double fromUnsignedLong(long x)
      Parameters:
      x - An unsigned integer value
      Returns:
      The given unsigned integer value as a double
    • toUnsignedLong

      public static long toUnsignedLong(double f)
      Parameters:
      f - A floating point value
      Returns:
      The given floating point value as a long
    • modulo

      public static double modulo(double x, double y) throws ArithmeticException
      Calculate the unsigned modulo x % y.
      Parameters:
      x - The dividend
      y - The divisor
      Returns:
      The unsigned modulo x % y
      Throws:
      ArithmeticException - Iff y < 0