]> www.ginac.de Git - ginac.git/blobdiff - doc/tutorial/ginac.texi
- fixed example of evalf-function.
[ginac.git] / 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