- fixed example of evalf-function.
authorRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Tue, 31 Jul 2001 21:28:10 +0000 (21:28 +0000)
committerRichard Kreckel <Richard.Kreckel@uni-mainz.de>
Tue, 31 Jul 2001 21:28:10 +0000 (21:28 +0000)
doc/tutorial/ginac.texi

index 4794837..81bfb7f 100644 (file)
@@ -4437,7 +4437,10 @@ function that does so, in this case the one in class @code{numeric}:
 @example
 static ex cos_evalf(const ex & x)
 @{
-    return cos(ex_to<numeric>(x));
+    if (is_a<numeric>(x))
+        return cos(ex_to<numeric>(x));
+    else
+        return cos(x).hold();
 @}
 @end example