On 02/07/2012 03:04 PM, Vitaly Davidovich wrote: > Can't the overflow test be (value ^ result) & (otherValue ^ result) < 0? > I think that's what hacker's delight suggests and you don't need the > negation and the sign bit mask in that case.
In gnu.math the "fixnums" are int, so I do long addition like this: long r = (long) value + (long) otherValue; int ri = (int) r; if ((int) ri == r) return makeFix(ri); else return makeBig(r); This is probably slower on older 32-bit CPUs. But with modern CPUs I doubt it matters what computation you do: what really matters are cache misses. -- --Per Bothner p...@bothner.com http://per.bothner.com/ _______________________________________________ mlvm-dev mailing list mlvm-dev@openjdk.java.net http://mail.openjdk.java.net/mailman/listinfo/mlvm-dev