]> www.ginac.de Git - ginac.git/commitdiff
- 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 4794837657af188b83c7b9ce68097b2ee01bcb8d..81bfb7f7b4725b573b2fcf39f87026a5fd72d75b 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