🐐 Small fix
This commit is contained in:
@@ -169,7 +169,7 @@ def frac_to_fraction(s, magnvm=False, svbnvlla=False):
|
|||||||
def fraction_to_frac(f, magnvm=False, svbnvlla=False):
|
def fraction_to_frac(f, magnvm=False, svbnvlla=False):
|
||||||
if f < 0:
|
if f < 0:
|
||||||
if not svbnvlla:
|
if not svbnvlla:
|
||||||
raise CentvrionError("Cannot display negative fractions without 'SVBNVLLA' module")
|
raise CentvrionError("Cannot display negative numbers without 'SVBNVLLA' module")
|
||||||
return "-" + fraction_to_frac(-f, magnvm, svbnvlla)
|
return "-" + fraction_to_frac(-f, magnvm, svbnvlla)
|
||||||
|
|
||||||
integer_part = int(f)
|
integer_part = int(f)
|
||||||
|
|||||||
@@ -236,7 +236,7 @@ static int write_val(CentValue v, char *buf, int bufsz) {
|
|||||||
long num = v.fval.num, den = v.fval.den;
|
long num = v.fval.num, den = v.fval.den;
|
||||||
if (den < 0) { num = -num; den = -den; }
|
if (den < 0) { num = -num; den = -den; }
|
||||||
if (num < 0)
|
if (num < 0)
|
||||||
cent_runtime_error("cannot display negative fraction without SVBNVLLA");
|
cent_runtime_error("cannot display negative numbers without SVBNVLLA");
|
||||||
long int_part = num / den;
|
long int_part = num / den;
|
||||||
long rem_num = num % den;
|
long rem_num = num % den;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user