Class UnsignedFloat

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

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

    • fromUnsignedInt

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

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

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

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

      public static float modulo(float x, float 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