diff options
| author | letouzey | 2012-07-30 13:45:36 +0000 |
|---|---|---|
| committer | letouzey | 2012-07-30 13:45:36 +0000 |
| commit | c2976e6279e9aa3a661e026957b058b9a00148b3 (patch) | |
| tree | b81b242ac2b4eaec8bde20dd8c53d3992103a4b6 /dev/include | |
| parent | 00f429861cc6bae9110d82aac2512fe5e55342bc (diff) | |
Bigint : better ensure canonicity of arrays of int blocks
In the chosen representation of negative numbers, (-base) is
actually legal as first element of an int array. This situation
was wrongly handled by many functions in this module, leading to
possible non-canonical representation of a big number, and hence
faulty "equal" answers or buggy output of "to_string".
For instance, on a 32-bit machine :
open Big_int;;
to_string (sub (of_string "-10000") (of_string "-1000000"));;
(* was displaying 9810000 instead of 990000 *)
Also simplified "of_string", which now rely on "neg" for handling
negative numbers.
Btw, improved checks comparing w.r.t OCaml's Big_int instead of float.
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/coq/trunk@15665 85f007b7-540e-0410-9357-904b9bb8a0f7
Diffstat (limited to 'dev/include')
0 files changed, 0 insertions, 0 deletions
