* Warren D Smith <warren.wds@gmail.com> [Aug 24. 2013 20:03]:
Grossman's solution only works on 2-complement machines with sign-propagating right-shift (for signed integers) but if you are willing to accept those restrictions is better than the solution in Joerg Arndt's ftxbook 1.11 (I haven't figured out what his restrictions are).
Two's complement, non- brain dead CPUs.
Yes, I said "your computer" which admittedly might already have a single "absolute value" machine instruction, for example... but basically, I'm satisfied.
For floats it's there IIRC (too lazy to look up, it's summer break; on x86 to be precise-ish).
I guess there really ought to be various versions of all Arndt's libraries, one for 2s complement machines,
I'd be surprised if even a tiny amount of current software would work on non- two's complement machines.
one for 1s complement machines
If I see correctly, there is only one line of them left, and an old one; to be gone soon.
etc etc,
... the empty set.
which one being detected by #IF statements that at compile time detect your machine type.
Possible but a bit of a nightmare: see GMP for what I think is a _very_ well-done software that's supposed to run on everything that's not intentionally screwed.
But, it gets a bit silly at some point. I mean. we'd be better off getting rid of the C language and replacing it with a better language.
That already happened (via post-increment): C++ Learning curve is admittedly OMGWTFARGLBLERGOHNOOOOO.
_______________________________________________ math-fun mailing list math-fun@mailman.xmission.com http://mailman.xmission.com/cgi-bin/mailman/listinfo/math-fun
Your's so OT, jj