Skip to content

Commit

Permalink
Merge pull request #446 from forzzzzz/patch-1
Browse files Browse the repository at this point in the history
fix log crash when x < 0
  • Loading branch information
Darkempire78 committed Apr 7, 2024
2 parents 80b0350 + 76a5315 commit 437ef8f
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ class Calculator(
}
}
"logten" -> {
if (x.compareTo(BigDecimal.ZERO) == 0) {
if (x <= BigDecimal.ZERO) {
domain_error = true
} else {
x = BigDecimal(log10(x.toDouble()))
Expand Down

0 comments on commit 437ef8f

Please sign in to comment.