From 61a028914d6e684ee50d5d32f3bdcdc7ec5f0cc0 Mon Sep 17 00:00:00 2001
From: "Vladimir V. Kisil" <kisilv@maths.leeds.ac.uk>
Date: Tue, 14 May 2019 13:11:13 +0100
Subject: [PATCH 2/3] Additional examples on number conversions.

Some aspects of these methods are not obvious for newbies.

Signed-off-by: Vladimir V. Kisil <kisilv@maths.leeds.ac.uk>
---
 doc/tutorial/ginac.texi | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/doc/tutorial/ginac.texi b/doc/tutorial/ginac.texi
index bc4b87fc..65ca5918 100644
--- a/doc/tutorial/ginac.texi
+++ b/doc/tutorial/ginac.texi
@@ -1533,6 +1533,15 @@ rational number will return a floating-point approximation. Both
 @code{to_int()/to_long()} and @code{to_double()} discard the imaginary
 part of complex numbers.
 
+Note the signature of the above methods, you may need to apply a type
+conversion and call @code{evalf()} as shown in the following example:
+@example
+    ...
+    ex e1 = 1, e2 = sin(Pi/5);
+    cout << ex_to<numeric>(e1).to_int() << endl
+        << ex_to<numeric>(e2.evalf()).to_double() << endl;
+    ...
+@end example
 
 @node Constants, Fundamental containers, Numbers, Basic concepts
 @c    node-name, next, previous, up
-- 
2.20.1

