algebra.instances

FloatAlgebra

class FloatAlgebra extends Field[Float] with Serializable

Due to the way floating-point equality works, this instance is not lawful under equality, but is correct when taken as an approximation of an exact value.

If you would prefer an absolutely lawful fractional value, you'll need to investigate rational numbers or more exotic types.

Linear Supertypes
Ordering
  1. Alphabetic
  2. By inheritance
Inherited
  1. FloatAlgebra
  2. Field
  3. MultiplicativeCommutativeGroup
  4. MultiplicativeGroup
  5. CommutativeRing
  6. CommutativeRng
  7. CommutativeRig
  8. MultiplicativeCommutativeMonoid
  9. CommutativeSemiring
  10. MultiplicativeCommutativeSemigroup
  11. Ring
  12. Rng
  13. AdditiveCommutativeGroup
  14. AdditiveGroup
  15. Rig
  16. MultiplicativeMonoid
  17. Semiring
  18. MultiplicativeSemigroup
  19. AdditiveCommutativeMonoid
  20. AdditiveCommutativeSemigroup
  21. AdditiveMonoid
  22. AdditiveSemigroup
  23. Serializable
  24. Serializable
  25. AnyRef
  26. Any
  1. Hide All
  2. Show all
Learn more about member selection
Visibility
  1. Public
  2. All

Instance Constructors

  1. new FloatAlgebra()

Value Members

  1. final def !=(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  2. final def !=(arg0: Any): Boolean

    Definition Classes
    Any
  3. final def ##(): Int

    Definition Classes
    AnyRef → Any
  4. final def ==(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  5. final def ==(arg0: Any): Boolean

    Definition Classes
    Any
  6. def additive: CommutativeGroup[Float]

  7. final def asInstanceOf[T0]: T0

    Definition Classes
    Any
  8. def clone(): AnyRef

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  9. def div(x: Float, y: Float): Float

    Definition Classes
    FloatAlgebraMultiplicativeGroup
  10. final def eq(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  11. def equals(arg0: Any): Boolean

    Definition Classes
    AnyRef → Any
  12. def finalize(): Unit

    Attributes
    protected[java.lang]
    Definition Classes
    AnyRef
    Annotations
    @throws( classOf[java.lang.Throwable] )
  13. def fromBigInt(n: BigInt): Float

    Convert the given BigInt to an instance of A.

    Convert the given BigInt to an instance of A.

    This is equivalent to n repeated summations of this ring's one, or -n summations of -one if n is negative.

    Most type class instances should consider overriding this method for performance reasons.

    Definition Classes
    FloatAlgebraRing
  14. def fromDouble(x: Double): Float

    This is implemented in terms of basic Field ops.

    This is implemented in terms of basic Field ops. However, this is probably significantly less efficient than can be done with a specific type. So, it is recommended that this method be overriden.

    This is possible because a Double is a rational number.

    Definition Classes
    FloatAlgebraField
  15. def fromInt(x: Int): Float

    Convert the given integer to an instance of A.

    Convert the given integer to an instance of A.

    Defined to be equivalent to sumN(one, n).

    That is, n repeated summations of this ring's one, or -n summations of -one if n is negative.

    Most type class instances should consider overriding this method for performance reasons.

    Definition Classes
    FloatAlgebraRing
  16. final def getClass(): Class[_]

    Definition Classes
    AnyRef → Any
  17. def hashCode(): Int

    Definition Classes
    AnyRef → Any
  18. final def isInstanceOf[T0]: Boolean

    Definition Classes
    Any
  19. def isOne(a: Float)(implicit ev: Eq[Float]): Boolean

    Tests if a is one.

    Tests if a is one.

    Definition Classes
    MultiplicativeMonoid
  20. def isZero(a: Float)(implicit ev: Eq[Float]): Boolean

    Tests if a is zero.

    Tests if a is zero.

    Definition Classes
    AdditiveMonoid
  21. def minus(x: Float, y: Float): Float

    Definition Classes
    FloatAlgebraAdditiveGroup
  22. def multiplicative: CommutativeGroup[Float]

  23. final def ne(arg0: AnyRef): Boolean

    Definition Classes
    AnyRef
  24. def negate(x: Float): Float

    Definition Classes
    FloatAlgebraAdditiveGroup
  25. final def notify(): Unit

    Definition Classes
    AnyRef
  26. final def notifyAll(): Unit

    Definition Classes
    AnyRef
  27. def one: Float

    Definition Classes
    FloatAlgebraMultiplicativeMonoid
  28. def plus(x: Float, y: Float): Float

    Definition Classes
    FloatAlgebraAdditiveSemigroup
  29. def positivePow(a: Float, n: Int): Float

    Attributes
    protected[this]
    Definition Classes
    MultiplicativeSemigroup
  30. def positiveSumN(a: Float, n: Int): Float

    Attributes
    protected[this]
    Definition Classes
    AdditiveSemigroup
  31. def pow(x: Float, y: Int): Float

  32. def product(as: TraversableOnce[Float]): Float

    Given a sequence of as, compute the product.

    Given a sequence of as, compute the product.

    Definition Classes
    MultiplicativeMonoid
  33. def reciprocal(x: Float): Float

    Definition Classes
    FloatAlgebraMultiplicativeGroup
  34. def sum(as: TraversableOnce[Float]): Float

    Given a sequence of as, compute the sum.

    Given a sequence of as, compute the sum.

    Definition Classes
    AdditiveMonoid
  35. def sumN(a: Float, n: Int): Float

  36. final def synchronized[T0](arg0: ⇒ T0): T0

    Definition Classes
    AnyRef
  37. def times(x: Float, y: Float): Float

    Definition Classes
    FloatAlgebraMultiplicativeSemigroup
  38. def toString(): String

    Definition Classes
    AnyRef → Any
  39. def tryProduct(as: TraversableOnce[Float]): Option[Float]

    Given a sequence of as, combine them and return the total.

    Given a sequence of as, combine them and return the total.

    If the sequence is empty, returns None. Otherwise, returns Some(total).

    Definition Classes
    MultiplicativeMonoidMultiplicativeSemigroup
  40. def trySum(as: TraversableOnce[Float]): Option[Float]

    Given a sequence of as, combine them and return the total.

    Given a sequence of as, combine them and return the total.

    If the sequence is empty, returns None. Otherwise, returns Some(total).

    Definition Classes
    AdditiveMonoidAdditiveSemigroup
  41. final def wait(): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  42. final def wait(arg0: Long, arg1: Int): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  43. final def wait(arg0: Long): Unit

    Definition Classes
    AnyRef
    Annotations
    @throws( ... )
  44. def zero: Float

    Definition Classes
    FloatAlgebraAdditiveMonoid

Inherited from Field[Float]

Inherited from MultiplicativeGroup[Float]

Inherited from CommutativeRing[Float]

Inherited from CommutativeRng[Float]

Inherited from CommutativeRig[Float]

Inherited from CommutativeSemiring[Float]

Inherited from Ring[Float]

Inherited from Rng[Float]

Inherited from AdditiveGroup[Float]

Inherited from Rig[Float]

Inherited from MultiplicativeMonoid[Float]

Inherited from Semiring[Float]

Inherited from MultiplicativeSemigroup[Float]

Inherited from AdditiveMonoid[Float]

Inherited from AdditiveSemigroup[Float]

Inherited from Serializable

Inherited from Serializable

Inherited from AnyRef

Inherited from Any

Ungrouped