Class FP64

    • Field Detail

      • ZERO

        private static final FP64 ZERO
        Additive neutral.
      • ONE

        private static final FP64 ONE
        Multiplicative neutral.
      • value

        private final double value
        Value.
    • Constructor Detail

      • FP64

        private FP64​(double value)
        Parameters:
        value - Value.
    • Method Detail

      • of

        public static FP64 of​(double value)
        Factory.
        Parameters:
        value - Value.
        Returns:
        a new instance.
      • add

        public FP64 add​(FP64 a)
        Binary addition.
        Specified by:
        add in interface Addition<FP64>
        Parameters:
        a - Element.
        Returns:
        this + a.
      • negate

        public FP64 negate()
        Additive inverse.
        Specified by:
        negate in interface Addition<FP64>
        Returns:
        -this.
      • multiply

        public FP64 multiply​(FP64 a)
        Binary multiplication.
        Specified by:
        multiply in interface Multiplication<FP64>
        Parameters:
        a - Element.
        Returns:
        this * a.
      • multiply

        public FP64 multiply​(int n)
        Repeated addition.
        Specified by:
        multiply in interface NativeOperators<FP64>
        Parameters:
        n - Number of times to add this to itself.
        Returns:
        n * this.
      • pow

        public FP64 pow​(int n)
        Repeated multiplication.
        Specified by:
        pow in interface NativeOperators<FP64>
        Parameters:
        n - Number of times to multiply this with itself.
        Returns:
        this^n.
      • equals

        public boolean equals​(java.lang.Object other)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • doubleValue

        public double doubleValue()
        Specified by:
        doubleValue in class java.lang.Number
      • floatValue

        public float floatValue()
        Specified by:
        floatValue in class java.lang.Number
      • intValue

        public int intValue()
        Specified by:
        intValue in class java.lang.Number
      • longValue

        public long longValue()
        Specified by:
        longValue in class java.lang.Number
      • byteValue

        public byte byteValue()
        Overrides:
        byteValue in class java.lang.Number
      • compareTo

        public int compareTo​(FP64 other)
        Specified by:
        compareTo in interface java.lang.Comparable<FP64>
      • zero

        public FP64 zero()
        Identity element.
        Specified by:
        zero in interface Addition<FP64>
        Returns:
        the field element such that for all a, zero().add(a).equals(a) is true.
      • one

        public FP64 one()
        Identity element.
        Specified by:
        one in interface Multiplication<FP64>
        Returns:
        the field element such that for all a, one().multiply(a).equals(a) is true.