Silvexil announced in his blog a Binary Arithmetic package. Here is my version of it.
BA:=module() export B,`+`,`-`,`*`,`/`,`^`;
local c;
`+`:=()->:-`+`(args); `-`:=()->:-`-`(args); `*`:=()->:-`*`(args); 
`/`:=()->:-`/`(args); `^`:=()->:-`^`(args);
c:=overload([
proc(a::{float,integer}) option overload; convert(a,binary) end,
proc(a::fraction) option overload; applyop(c,{1,2},a) end,
proc(a::Not(numeric)) option overload; subsindets(a,numeric,c) end]);
B:=(a::uneval)->c(eval(subsindets(a,numeric,x->convert(x,decimal,2)))) end:
Here are some examples,
with(BA):
Digits:=30:
B((10101-10)*11001+100101);
                              1000000000
B(101/110+10011/1101001);
                               1000111
                               -------
                               1000110
B(11^10);
                                 1001
B(evalf(Pi+10));
                   101.001001000011111101101010100
B(combine(sin(10)*cos(10)));
                            1/10 sin(100)
B(110!);
                              1011010000
B(sqrt(10));
                                 (1/10)
                               10
B(sqrt(10.));
                   1.01101010000010011110011001100
B(11.0011^1.101);
                   110.100101000000010001101000111
It still has a glitch with scientific notation,
B(0.1*10^10000);
                                            16
                       0.1000000000000000 10


Please Wait...