newRPL  build 1255 released! [updated to 1299]

01262019, 05:23 PM
Post: #369




RE: newRPL  build 1089 released! [update:build 1158]
(01262019 04:55 PM)The Shadow Wrote: In the new version, 'X*X' now becomes 'X^2'. Whew! However, while 'X^2*X' becomes 'X^3', 'X*X^2' does not. If that's because you're using noncommutative multiplication, you needn't bother for that case  it takes quite a lot of warping and spindling of the multiplication operator before powers stop making sense. Even sedenions, for which multiplication isn't commutative, associative, or even alternative have welldefined powers which are the same from the left and from the right (or indeed, in any order with any set of parentheses). True, rectangular matrices don't have powers, but then those expressions would error in any case.You are correct but you are missing the case with more factors. If we accept commutative multiplication it will shuffle all factors until it matches, so X*Y*X^2 will also match and become Y*X^3 which is incorrect for matrices. I just need to add the other noncommutative cases (01262019 04:55 PM)The Shadow Wrote: I'm also a little puzzled by the parity attribute. What is the difference between a number being 'known to be odd' and being 'known to be an odd integer'? Are there nonintegers for which parity is defined? I suppose you could define halfintegers (ie, '1/2', '3/2', '5/2' and so on) to be odd in some sense, but I've never run across it before.It needs to be a separate bit, so that odd integers are a subset of integers when you AND their attributes. As a result, some weird combinations can result like numbers with the odd bit set but not the integer bit. Whether we ignore those cases mathematically or not doesn't really matter. It's a way to keep performance to a decent level. I just AND the attributes and check the result to determine if the expression matches or not. (01262019 04:55 PM)The Shadow Wrote: By the way, parity can be defined for complex numbers too  at least in the Gaussian integers. Anything divisible by '1+i' (which has a norm of 2) is even, all other Gaussian integers are odd. That works out to, "If the real and imaginary parts have the same parity, the complex number is even. If they have different parity, it's odd." For the real integers, that gives the usual parity, but in the Gaussian integers as a whole, you get a checkerboard pattern. Is there a simple way to check if a complex is odd or even? If it won't perform I can't add it. For real numbers I just get the last digit and test one bit, that's fast enough so it doesn't bog the system (the idea is that some commands will be running hundreds of rules, so this needs to be fast). 

« Next Oldest  Next Newest »

User(s) browsing this thread: 1 Guest(s)