On Friday, December 19, 2003, at 11:17 AM, Thomas Fischbacher wrote: > Please note that this bug concerns the "old" Num implementation that > was > removed in a recent update. This bug is in fact in the ML part of the Num library, which is common to both the old and new Num implementations. I think it dates back to Caml Light. > The attachment will reproduce a condition where doing the same > calculation > (which is purely functional to the outside and does not use global > state > or side effects, but involves Num) many times in sequence will give > different results. This "nondeterminism" comes from using a Nat.nat with an uninitialised digit, using whatever was already in memory at that address. > arithmetics I am using? Yet to me it seems plausible that some serious > issue may have been overlooked here, since I suppose very few people > use > ratio arith (in contrast to bignum-only arith, which has applications > for, > e.g., RSA). Indeed, the bug is in the big-int part of the library (arbitrary precision signed integers). Thank you for your well-delimited bug report with a reproducible test case. It was rather easy to find the bug with it. I enclose a patch, which should work on 3.06 and on 3.07pl2. -- Damien