28 Reputation

14 years, 235 days

Preventing automatic simplification...

If a module F exports `+`, then > with( F ); > 3 + 4; calls F:-`+`( 3, 4 ) and > x + x; calls F:-`+`( x, x ), so it is possible to prevent automiatic simplfication by using a module with appropriate exports (`*`, `-`, etc.)

Hmmm... I think I know how to fix the first one, but it will be interesting... Unfortunately, you have to determine when Maple will display output in scientific form and when it will display it in standard form, and that will require looking at some values set by the interface function. evalf is certainly a candidate... I'll fix that some time soon. Unfortunately, Digits is an envrionment variable, so I cannot set it in a procedure, as it will be reset when the procedure exits, though I will add a recommendation that this should be done manually. Actually, 10001 - 1110 = 10, so 10*111011 = 1110110, so while B does return something which looks like a binary number, it isn't the correct answer. It would have been *really* cool if it was, though... As for the other observations, convert/decimal from binary assumes that the number is in the appropriate form, namely a[0] + a[1]*2 + a[2]*2^2 + a[3]*2^3 + ... If the user is going declar that the number is binary, it would be an extreme waste of computing power to check each and every digit to determine if it is 0 or 1, and 3502 = 2 + 5*4 + 3*8 is still a well defined, if bizarre binary number. (Well, my opinion, but you can object to that...) In this case, 10! = 3628800 which is interpted as 8*4 + 8*8 + 2*16 + 6*32 + 3*64 = 512 by convert/decimal, and 512 converted back to binary is 10000000000. I just realized: convert( 1010011, decimal, 2 ); which is a lot more convenient than convert( 1010011, decimal, binary )......... The help pages should be changed to emphasize this easier input, in my opinion. Oh yes, this is very cool: ``` > convert( `3abmd5u32`, decimal, 23 ); 270754919347 ``` The symbol is interpreted as a base 23 number... Thank you very much for the comments.