diff options
| author | herbelin | 2002-10-13 22:02:23 +0000 |
|---|---|---|
| committer | herbelin | 2002-10-13 22:02:23 +0000 |
| commit | e78af013674e54dd582c951e6f56285ad0afbc17 (patch) | |
| tree | 4aed59f07cf6c330b8850c6a52296d1baa595d4d /lib | |
| parent | 9378fe521718b42774727b6266159f0f0b804917 (diff) | |
Bug affichage du chiffre 0
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@3130 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/bignat.ml | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/lib/bignat.ml b/lib/bignat.ml index bb567cc241..7859a780df 100644 --- a/lib/bignat.ml +++ b/lib/bignat.ml @@ -15,6 +15,7 @@ type bignat = int array let digits = 8 let base = 100000000 (* let enough room for multiplication by 2 *) let base_div_2 = 50000000 +let base_to_string x = Printf.sprintf "%08d" x let of_string s = let a = Array.create (String.length s / digits + 1) 0 in @@ -28,7 +29,10 @@ let of_string s = let rec to_string s = if s = [||] then "0" else if s.(0) = 0 then to_string (Array.sub s 1 (Array.length s - 1)) - else String.concat "" (Array.to_list (Array.map string_of_int s)) + else + String.concat "" + ((string_of_int (s.(0))) + ::(List.tl (Array.to_list (Array.map base_to_string s)))) let is_nonzero a = let b = ref false in Array.iter (fun x -> b := x <> 0 || !b) a; !b |
