summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/rationals.adb4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/rationals.adb b/src/rationals.adb
index 2255afe..7ae321c 100644
--- a/src/rationals.adb
+++ b/src/rationals.adb
@@ -339,7 +339,7 @@ package body Rationals is
(Item : in Fraction)
return Integer is
begin
- if Item.Num mod Item.Den > Standard."/" (Item.Den, 2) then
+ if Item.Num mod Item.Den >= Standard."/" (Item.Den, 2) then
return 1 + Item.Num / Item.Den;
else
return Item.Num / Item.Den;
@@ -371,7 +371,7 @@ package body Rationals is
S := Index (Item, "/");
A := Integer'Value (Item (Item'First .. S - 1));
B := Integer'Value (Item (S + 1 .. Item'Last));
- return (Num => A, Den => B);
+ return Reduce (A, B);
end Value;