diff options
Diffstat (limited to '.local/share/bin/=')
-rwxr-xr-x | .local/share/bin/= | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/.local/share/bin/= b/.local/share/bin/= index 59b9b45..dd8ba6c 100755 --- a/.local/share/bin/= +++ b/.local/share/bin/= @@ -1,2 +1,16 @@ -#!/bin/sh -python3 -c "from math import *; deg = pi / 180; print($*)" +#!/bin/python3 -- +from sys import argv as _argv + +from math import * +deg = pi / 180 + +MIN = min +MAX = max +BIT = lambda n: 1 << n +GENMASK = lambda h, l: (BIT(MAX(h, l) + 1) - 1) ^ (BIT(MIN(h, l)) - 1) + +try: + print(eval(" ".join(_argv[1:]))) +except: + exit(1) + |