On Mon, 2009-09-28 at 23:58 -0400, John Cowan wrote:
> Ray Dillinger scripsit:
>
> > With overflow to an inexact number, the first failure condition is that
> > you get your answer but it may be off by one part per million or so,
> > which is not so dire.
> >
> > But at the same moment, your program has lost the ability to use it in
> > further operations requiring exact integers, such as using its modulus
> > as a vector index, etc, and this may result in a dire failure later --
> > usually an execution abort when the program attempts something it just
> > isn't allowed to do with inexact numbers.
>
> I agree with all of your other points, but I think this objection is more
> theoretical than real. Most people don't have in-memory datastructures
> with more than 16M elements, and therefore are unlikely to get that sort
> of crash.
In the presence of data sets with a very large number of possible
keys, I frequently use hash tables in which the modulus of the key
to the size of the table is used as an index into the table.
So key number 16283 in a hashtable with 100 elements would go into
bucket 83, for example, because (modulus 16283 100) ==> 83 .
The problem is that (modulus #i16283 100) ==> #i83 and #i83 cannot
be used as an array index.
Bear
_______________________________________________
r6rs-discuss mailing list
[email protected]
http://lists.r6rs.org/cgi-bin/mailman/listinfo/r6rs-discuss