]> thyrsus.com Git - mad.git/commitdiff
sin. and cos. require the math library.
authorEric S. Raymond <esr@thyrsus,com>
Sat, 14 Feb 2004 16:59:28 +0000 (16:59 +0000)
committerEric S. Raymond <esr@thyrsus,com>
Sat, 14 Feb 2004 16:59:28 +0000 (16:59 +0000)
mad

diff --git a/mad b/mad
index a9481c5d278ff3ea4654eda2f8a84b38d7af0ce0..559c05c0ac1dc4813e087e210fe7455d5d1c3f5c 100755 (executable)
--- a/mad
+++ b/mad
@@ -468,7 +468,7 @@ def p_function_application(t):
     'expression : FUNCALL application'
     t[0] = ('apply', t[1], tuple(t[2]))
     global headers
-    if t[1] in ('elog.', 'sqrt.') and "math" not in headers:
+    if t[1] in madmath and "math" not in headers:
         headers.append("math")
 
 def p_expression_funcall0(t):
@@ -493,6 +493,9 @@ yacc.yacc()
 
 import sys, re
 
+# These will require the math library.
+# All but tan. are in the manual examples.
+madmath = ('elog.','sqrt.','sin.','cos.','tan.',)
 # Map MAD intrinsics to C library functions
 madfunc_map = {'elog':'log'}