Skip to content

Commit

Permalink
Merge pull request #547 from ceedubs/fix-float
Browse files Browse the repository at this point in the history
Fix monoid zeros for Float/Double
  • Loading branch information
non committed Sep 28, 2015
2 parents 682a394 + 6bbe582 commit 5b45c9e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/src/main/scala/cats/std/anyval.scala
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ trait FloatInstances /* missing algebra type classes */ {
implicit val floatAlgebra: CommutativeGroup[Float] with Order[Float] =
new CommutativeGroup[Float] with Order[Float] {
def combine(x: Float, y: Float): Float = x + y
def empty: Float = 1F
def empty: Float = 0F
def inverse(x: Float): Float = -x
def compare(x: Float, y: Float): Int =
java.lang.Float.compare(x, y)
Expand All @@ -112,7 +112,7 @@ trait DoubleInstances /* missing algebra type classes */ {
implicit val doubleAlgebra: CommutativeGroup[Double] with Order[Double] =
new CommutativeGroup[Double] with Order[Double] {
def combine(x: Double, y: Double): Double = x + y
def empty: Double = 1D
def empty: Double = 0D
def inverse(x: Double): Double = -x
def compare(x: Double, y: Double): Int =
java.lang.Double.compare(x, y)
Expand Down

0 comments on commit 5b45c9e

Please sign in to comment.