summaryrefslogtreecommitdiffstats
path: root/otherlibs
diff options
context:
space:
mode:
Diffstat (limited to 'otherlibs')
-rw-r--r--otherlibs/num/nat.ml4
1 files changed, 3 insertions, 1 deletions
diff --git a/otherlibs/num/nat.ml b/otherlibs/num/nat.ml
index 2c7e7a91c..981f83539 100644
--- a/otherlibs/num/nat.ml
+++ b/otherlibs/num/nat.ml
@@ -355,8 +355,10 @@ let int_to_string int s pos_ref base times =
(* XL: suppression de adjust_string *)
let power_base_int base i =
- if i = 0 then
+ if i = 0 || base = 1 then
nat_of_int 1
+ else if base = 0 then
+ nat_of_int 0
else if i < 0 then
invalid_arg "power_base_int"
else begin