Skip to content

Commit

Permalink
fix multiplyExact (use overload from Java 1.8)
Browse files Browse the repository at this point in the history
  • Loading branch information
aslesarenko committed Jun 28, 2019
1 parent 61e8ec8 commit 5136809
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class IntMinMonoid(val zero: Int) extends Monoid[Int] {

class LongPlusMonoid(val zero: Long) extends Monoid[Long] {
def plus(x: Long, y: Long): Long = Math.addExact(x, y)
def power(x: Long, n: Int): Long = Math.multiplyExact(x, n)
def power(x: Long, n: Int): Long = Math.multiplyExact(x, n.toLong)
}

class LongMaxMonoid(val zero: Long) extends Monoid[Long] {
Expand Down

0 comments on commit 5136809

Please sign in to comment.