QuoteOriginally posted by: CuchulainnQuoteOriginally posted by: Traden4AlphaQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: Traden4AlphaQuoteOriginally posted by: CuchulainnQuoteOriginally posted by: bluetrinThis property:http://en.wikipedia.org/wiki/Associativ ... ssociative
? Is it useful?Not for computers (it doesn't hold for floats, doubles, etc.)Yes.Floats form a groupoid but not a semigroup (== associative groupoid). And groupoid inverses are not necessarily unique...Mathematically, you can say that groupoids have very little structure.// BTW is a + b = b + a true for floats? I would have said that addition is commutative for floats (and doubles) until you raised the issue of guard digits. I don't know the architecture of modern CPU ALUs and registers well enough to know what happens if one does math to a number that's the result of prior math operation rather than pulled from memory. I'd assume that the two entry points into the ALU are symmetrical, but if there's a short-cut that can take the output of the ALU and make in the input for the next calculation, then it may make a difference and break commutativity.I suppose commutativity will have the same issues as associativity, especilly if the compiler is producing intermediate results. Then it will not be an Abelian groupoid, which is kind of worrying.Associativity and commutativity have different kinds of issues because violations occur in different layers. Associativity cannot be true for any finite-digit floating point representation on any hardware implementation. In contrast, commutativity can always be true on any finite-digit floating point representation but might possibly fail in some hardware implementations.