diff --git a/scicalc b/scicalc index 1667b1d..91e40f2 100755 --- a/scicalc +++ b/scicalc @@ -2,8 +2,8 @@ # # A simple command-line scientific calculator. # - import sys, math +import numpy as np def die_with_usage(message): print("\n****\n**** error: {}\n****\n".format(message), file=sys.stderr) @@ -47,6 +47,12 @@ def log10(x): """Return a base-10 logarithm of x""" return math.log10(x) + +def tan(x): + """Return the value of tan(x)""" + + return np.tan(x) + # # The dictionary that maps the command-line name of the operation, @@ -58,6 +64,7 @@ operators = { 'sum': add, 'mul': mul, 'log10': log10, + 'tan': tan, } if __name__ == "__main__":