Skip to content

Commit

Permalink
Fixed division by zero exception in assFormulaQuestionResult::convert…
Browse files Browse the repository at this point in the history
…DecimalToCoprimeFraction()
  • Loading branch information
matheuszych committed Apr 26, 2024
1 parent 35d7993 commit 1f10924
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -846,6 +846,10 @@ public static function isCoprimeFraction($numerator, $denominator): bool

public static function convertDecimalToCoprimeFraction($decimal_value, $tolerance = 1.e-9)
{
if ($decimal_value) {
return '';
}

$to_string = (string) $decimal_value;
$is_negative = strpos($to_string, '-') === 0;
if ($is_negative) {
Expand Down

0 comments on commit 1f10924

Please sign in to comment.