For each caret:
Take the entire selection as a string or the current line if no selection
Strip out all whitespace from that string
Evaluate that string as an arithmetic expression (supporting + - * / ( and ))
if the evaluation succeeds
replace the caret selection (or the line if no selection) with the numeric result of the evaluation
For each caret:
Take the entire selection as a string or the current line if no selection
Strip out all whitespace from that string
Evaluate that string as an arithmetic expression (supporting
+-*/(and))if the evaluation succeeds
replace the caret selection (or the line if no selection) with the numeric result of the evaluation