Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

Equal bignums don compare as equal! What gives?

bignums compare gives
0
Posted

Equal bignums don compare as equal! What gives?

0

Ah, Grasshopper, I see you are using (eq x y). The Bodhisattva CLTL2 warned of the illusion that equal numbers would be `eq’! Meditate on the deeper truths of `eql’, in which numbers of the same type which have equal values compare equal, and `=’, which does any necessary type coercions before comparing for equality. Yeah, yeah, it has always worked for integer types, because fixnums and characters have an immediate representation. Sorry about that; arbitrary precision obviously requires consing new objects because the objects are “large” and of variable size, and the definition of `eq’ does not permit different objects to compare as equal.

Related Questions

What is your question?

*Sadly, we had to bring back ads too. Hopefully more targeted.

Experts123