mruby-rational: add comments

We used `mrb_bint_mul(mrb, n, ONE)` to normalize `n`. The code confused
ChatGPT that could not read the intention.
This commit is contained in:
Yukihiro "Matz" Matsumoto
2024-10-14 08:05:34 +09:00
parent 8cfc1a4581
commit 51b11a6919
+2
View File
@@ -116,6 +116,7 @@ rational_numerator(mrb_state *mrb, mrb_value self)
{
mrb_value n = rat_numerator(mrb, self);
if (mrb_bigint_p(n)) {
/* normalize bigint */
return mrb_bint_mul(mrb, n, ONE);
}
return n;
@@ -139,6 +140,7 @@ rational_denominator(mrb_state *mrb, mrb_value self)
{
mrb_value n = rat_denominator(mrb, self);
if (mrb_bigint_p(n)) {
/* normalize bigint */
return mrb_bint_mul(mrb, n, ONE);
}
return n;