Alfred unit converter is a smart calculator for Alfred with support for unit conversions to make it a bit comparable to the Google Calculator and Wolfram Alpha.
This PR prevents replacement of numbers in function names with Decimals, using a negative look-behind to remove decimal matches immediately preceded by letters or numbers. It also adds the math.log2() function.
The query "log10()" was broken, as the "log10" string was being converted to "logDecimal(10)" in )", which produced an error.
safe_eval()
: https://github.com/wolph/alfred-converter/blob/49f3053932ee4ef13cecdeccc030fa52e5cab4b9/converter/safe_math.py#L209 Thus, the resulting query was "logDecimal(10)(This PR prevents replacement of numbers in function names with
Decimal
s, using a negative look-behind to remove decimal matches immediately preceded by letters or numbers. It also adds themath.log2()
function.