[Question]
  [
Write a function or program than can do simple arithmetic (addition, subtraction, multiplication and division) in both base 10 and base 2.
The function will take a mathematical expression as input, and output the correct result in the correct base. The input will be `n` numbers separated by one or several operators (`+ - * /`). 
If all input values contain only 0 and 1, all values are considered to be binary. If at least one digit is `2-9`, all values are considered to be base 10.
**Rules:**
* You can assume there will only be one operator between numbers (`10*-1` will not appear)
* You can assume there will be no parentheses.
* Normal operator precedence (try the expression in the google calculator if you're in doubt).
* You can not assume there will only be integers
* There will be no leading zeros in input or output
* You can assume only valid input will be given
* You can assume all input values are positive (but the minus operator may make negative output possible, `1-2=-1` and `10-100=-10`)
* REPL is not accepted
* You may choose to take the input as separate arguments, or as a single argument, but the input *has* to be in the correct order.
	+ I.e. you may represent `1-2` with the input arguments `1`, `-`, `2`, but not `1`, `2`, `-`.
* You must accept the symbols `+ - * /` in the input, not `plus`, `minus` etc.
* You must support floating point values (or up to the maximum limit of your language, however supporting only integers is not accepted).
* `eval` is accepted
**Examples:**
```
1+1
10
1010+10-1
1011
102+10-1
111
1+2+3
6
10*10*10
1000
11*11*11
11011
10*11*12+1
1321
10.1*10.1
110.01
20.2*20.2
408.04
10/5
2
110/10
11
Also accepted (optional line or comma-separated input):
10
+
10
-
1
11    <-- This is the output
```
This is code golf, so the shortest code in bytes will win.
  
[Answer]
## JavaScript ES6, ~~87~~ ~~971~~ ~~1002~~ ~~1063~~ ~~102~~ ~~101~~ ~~98~~ ~~1004~~ ~~93~~ ~~88~~ 86 bytes
```
e=>eval(e.match`[2-9]`?e:`(${e.replace(/[\d.]+/g,"('0b'+$&e14)/16384")}).toString(2)`)
```
Demo + explanation:
```
function c(e){
    return eval(                        
      e.match`[2-9]`?                  //check if there are numbers 2 to 9
        e:                             //if there're, just compute the result
        "("+                           
         e.replace(                    //otherwise replace...
           /[\d.]+/g,                  //any number...
           "(('0b'+$&e14)/16384)"    //...with itself converted to base 10
         )
        +").toString(2)"               //compute the result and convert it to binary
    )
}
document.write(
   c("1.1*1.1")+"<br>"+
   c("1010+10-1")+"<br>"+
   c("102+10-1")+"<br>"+
   c("1+2+3")+"<br>"+
   c("10*10*10")+"<br>"+
   c("11*11*11")+"<br>"+
   c("10*11*12+1")+"<br>"+
   c("10.1*10.1")+"<br>"+
   c("20.2*20.2")+"<br>"+
   c("10/5")+"<br>"+
   c(`10
      +
      10
      -
      1`)
)
```
---
1 - forgot about floats  
2 - again floats problem: parseInt floors binary so I have to multiply by 1e14 and then divide by 16384  
3 - hope that's achieved the given task, now start to golf :D  
4 - there was a bug with dividing
[Answer]
## Japt, ~~77~~ ~~72~~ ~~62~~ ~~60~~ ~~62\*~~ ~~60~~ ~~59~~ 51 bytes
```
OvUf"[2-9]" ?U:"({Ur"[\\d.]+""¬∫$&e14+P n2 /2pE¬π"})¬§
```
Explanation (more or less the same as for the JS answer):
```
Ov                       //eval...
  Uf"[2-9]"              //if input contains the digits 2 to 9
    U:                   //then it's base 10, just compute
    Ur"[\\d.]+"          //otherwise replace all the numbers
    "¬∫$&e14+P n2 /2pE¬π"  //with their base 10 equivalents
                         //I.e., take every number, multiple by 10^14, convert to
                         //base 10 and divide by 2^14
                         // ¬∫ and ¬π are multiple brackets
    ¬§                    //means "s2", i.e. convert the result to binary
                 
```
[Try it online!](http://ethproductions.github.io/japt?v=master&code=T3ZVZiJbMi05XSIgP1U6Iih7VXIiW1xcZC5dKyIiuiQmZTE0K1AgbjIgLzJwRbkifSmk&input=IjEwLjEqMTAuMSI=)
---
\* didn't divide properly
[Answer]
# Jolf, 31 bytes, noncompeting
I added a decent amount of functions inspired by this challenge, and, as thus, it is considered noncompeting. I'm happy because I finally implemented unary functions (like `(H,S,n)=>val` in ES6, but are supported in ES5!)
```
? hi"[2-9]"~eiB~epT mpvid|m'H2H
? hi"[2-9]"                     if the input contains any of 2..9
           ~ei                   evaluate i (implicitly print)
                                else
                   _mpvid        map the input split into number groups
                          m'H2    to H as a binary float
                         |    H   (or keep H, if that doesn't work)
                 pT              join by spaces
               ~e                evaluate
              B                  convert to binary (implicitly print)
```
[Test suite](http://conorobrien-foxx.github.io/Jolf/#code=PyBoaSJbMi05XSJ-ZWlCfmVwVCBtcHZpZHxtJ0gySA&input=MSsxCgoxMDEwKzEwLTEKCjEwMisxMC0xCgoxKzIrMwoKMTAqMTAqMTAKCjExKjExKjExCgoxMCoxMSoxMisxCgoxMC4xKjEwLjEKCjIwLjIqMjAuMgoKMTAvNQoKMTEwLzEw), [Try your own input](http://conorobrien-foxx.github.io/Jolf/#code=PyBoaSJbMi05XSJ-ZWlCfmVwVCBtcHZpZHxtJ0gySA), [or manually set the input](http://conorobrien-foxx.github.io/Jolf/#code=b2kiWU9VUiBRVUVSWSBIRVJFIgo_IGhpIlsyLTldIn5laUJ-ZXBUIG1wdmlkfG0nSDJI).
[Answer]
# Bash, 60 bytes
```
[ -z `tr -dc 2-9<<<$1` ]&&s='obase=2;ibase=2;';bc -l<<<$s$1
```
Example Run:
```
$ ./bin_dec_add.sh 1+1
10
$ ./bin_dec_add.sh 1+2
3
```
[Answer]
# ùîºùïäùïÑùïöùïü 2, 46 chars / 72 bytes
```
√´(√Øƒë/[2-9]‚éû?√Ø:`(‚¶É√Øƒì/[\d.]+‚åø,‚Ü™(’Ö+$*·∏ä‚Åø·∏é)/·∫Ä¬≤)})‚ìë`
```
`[Try it here (Firefox only).](http://molarmanful.github.io/ESMin/interpreter2.html?eval=false&input=10.1*10.1&code=%C3%AB%28%C3%AF%C4%91%2F%5B2-9%5D%E2%8E%9E%3F%C3%AF%3A%60%28%E2%A6%83%C3%AF%C4%93%2F%5B%5Cd.%5D%2B%E2%8C%BF%2C%E2%86%AA%28%D5%85%2B%24*%E1%B8%8A%E2%81%BF%E1%B8%8E%29%2F%E1%BA%80%C2%B2%29%7D%29%E2%93%91%60)`
# Explanation
```
√´(√Øƒë/[2-9]‚éû?√Ø:`(‚¶É√Øƒì/[\d.]+‚åø,‚Ü™(’Ö+$*·∏ä‚Åø·∏é)/·∫Ä¬≤)})‚ìë` // implicit: √Ø=input, ·∏ä=10, ·∏é=14, ·∫Ä=128
√´(                                              // eval
  √Øƒë/[2-9]‚éû?                                    // does √Ø have 2-9?
            √Ø                                   // if so, eval input
             :                                  // else, eval:
              `(‚¶É√Øƒì/[\d.]+‚åø,                    // replace the binary numbers
                                                // with their base 10 equivalents:
                            ‚Ü™(’Ö+                // translates to `0b`
                                $*·∏ä‚Åø·∏é           // matched number * 10^14
                                     )/·∫Ä¬≤       // divided by 128^2
                                         )})‚ìë` // converted to binary
                                                // implicit output
```
[Answer]
# PowerShell, 107 bytes
```
param($e)iex(("{0}String($($e-replace'(\d+)','{0}Int32("$1",2)'),2)"-f'[Convert]::To'),$e)[$e-match'[2-9]']
```
# Ungolfed
```
param($e) # Accept single argument
Invoke-Expression # Eval
  ( # Expression, resulting in an array of 2 elements
    (
      "{0}String( # Binary
        $( # Inline subexpression
          $e -replace'(\d+)', '{0}Int32("$1",2)'
          # "1010+10-1" becomes "{0}Int32("1010",2)+{0}Int32("10",2)-{0}Int32("1",2)"
        )
      ,2)"
      -f '[Convert]::To'
      # "{0}Int32("1010",2)+{0}Int32("10",2)-{0}Int32("1",2)" becomes
        "[Convert]::ToString([Convert]::ToInt32("1010",2)+[Convert]::ToInt32("10",2)-[Convert]::ToInt32("1",2),2)"
    ),
      $e # Plain
    )
    [$e-match'[2-9]'] # Return 1st element of array if regex matches, else 0
```
# Example
```
PS > .\Calc.ps1 1010+10-1
1011
PS > .\Calc.ps1 20.2*20.2
408,04
```
]