Alexei<br>Thanks for answering my question. I think I understand what  to do. Suppose I say,<br>cln_R  x = 3.4;<br>then I computer exp(x),<br>now I convert it to cln_F,<br>Can I do so at any precision. Is exp(x) just a symbolic computation, and does the actual computation come about only when converting to a cln_F?<br>
<br>Thanks<br><br><br><div class="gmail_quote">On Tue, May 18, 2010 at 4:45 PM,  <span dir="ltr">&lt;<a href="mailto:cln-list-request@ginac.de">cln-list-request@ginac.de</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Send CLN-list mailing list submissions to<br>
        <a href="mailto:cln-list@ginac.de">cln-list@ginac.de</a><br>
<br>
To subscribe or unsubscribe via the World Wide Web, visit<br>
        <a href="https://www.cebix.net/mailman/listinfo/cln-list" target="_blank">https://www.cebix.net/mailman/listinfo/cln-list</a><br>
or, via email, send a message with subject or body &#39;help&#39; to<br>
        <a href="mailto:cln-list-request@ginac.de">cln-list-request@ginac.de</a><br>
<br>
You can reach the person managing the list at<br>
        <a href="mailto:cln-list-owner@ginac.de">cln-list-owner@ginac.de</a><br>
<br>
When replying, please edit your Subject line so it is more specific<br>
than &quot;Re: Contents of CLN-list digest...&quot;<br>
<br>
<br>
Today&#39;s Topics:<br>
<br>
   1. confusion with cln::cl_F and cln::cl_R (Joshua Friedman)<br>
   2. Re: confusion with cln::cl_F and cln::cl_R (Alexei Sheplyakov)<br>
<br>
<br>
----------------------------------------------------------------------<br>
<br>
Message: 1<br>
Date: Tue, 18 May 2010 11:22:25 -0400<br>
From: Joshua Friedman &lt;<a href="mailto:crowneagle@gmail.com">crowneagle@gmail.com</a>&gt;<br>
To: <a href="mailto:cln-list@ginac.de">cln-list@ginac.de</a><br>
Subject: [CLN-list] confusion with cln::cl_F and cln::cl_R<br>
Message-ID:<br>
        &lt;<a href="mailto:AANLkTimibjqTFsn4dXLgX946oMrL7E7rmMaiu-eEZFVk@mail.gmail.com">AANLkTimibjqTFsn4dXLgX946oMrL7E7rmMaiu-eEZFVk@mail.gmail.com</a>&gt;<br>
Content-Type: text/plain; charset=&quot;windows-1252&quot;<br>
<br>
The program runs when I define &quot;bigF = cln_R&quot;, but I get errors when I set<br>
&quot;bigF = cln_F&quot;<br>
I found that the exponential function only gives many digits of precision<br>
when I use cln_F.<br>
I am attaching my program and the out put is below:<br>
<br>
fuji:rama joshua$ make<br>
g++ -DHAVE_CONFIG_H -I.  -I../include -I../include   -g -O2 -MT e.o -MD -MP<br>
-MF .deps/e.Tpo -c -o e.o e.cc<br>
In file included from /usr/include/c++/4.0.0/backward/iostream.h:31,<br>
                 from e.cc:1:<br>
/usr/include/c++/4.0.0/backward/backward_warning.h:32:2: warning: #warning<br>
This file includes at least one deprecated or antiquated header. Please<br>
consider using one of the 32 headers found in section 17.4.1.2 of the C++<br>
standard. Examples include substituting the &lt;X&gt; header for the &lt;X.h&gt; header<br>
for C++ includes, or &lt;iostream&gt; instead of the deprecated header<br>
&lt;iostream.h&gt;. To disable this warning use -Wno-deprecated.<br>
e.cc: In function ?bigF h(bigF, bigF*, int, int, int)?:<br>
e.cc:233: error: conversion from ?const cln::cl_N? to non-scalar type ?bigF?<br>
requested<br>
e.cc: In function ?bigF ff(bigF, bigF, bigF*, int, int, int)?:<br>
e.cc:251: error: no match for ?operator=? in ?q = cln::operator*(const<br>
cln::cl_R&amp;, const cln::cl_R&amp;)(((const cln::cl_R&amp;)(&amp; cln::exp(const<br>
cln::cl_R&amp;)())))?<br>
../include/cln/float_class.h:40: note: candidates are: cln::cl_F&amp;<br>
cln::cl_F::operator=(const cln::cl_F&amp;)<br>
../include/cln/float_class.h:47: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(float)<br>
../include/cln/float_class.h:48: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(double)<br>
e.cc:258: error: conversion from ?const cln::cl_N? to non-scalar type ?bigF?<br>
requested<br>
e.cc: In function ?bigF v(bigF, bigF*, int, int, int)?:<br>
e.cc:275: error: conversion from ?int? to ?cln::cl_F? is ambiguous<br>
../include/cln/float_class.h:38: note: candidates are:<br>
cln::cl_F::cl_F(cln::cl_anything*)<br>
../include/cln/float_class.h:26: note:                 cln::cl_F::cl_F(const<br>
char*)<br>
../include/cln/float_class.h:48: note:<br>
cln::cl_F::cl_F(double)<br>
../include/cln/float_class.h:47: note:<br>
cln::cl_F::cl_F(float)<br>
e.cc:276: error: conversion from ?int? to ?cln::cl_F? is ambiguous<br>
../include/cln/float_class.h:38: note: candidates are:<br>
cln::cl_F::cl_F(cln::cl_anything*) &lt;near match&gt;<br>
../include/cln/float_class.h:26: note:                 cln::cl_F::cl_F(const<br>
char*) &lt;near match&gt;<br>
../include/cln/float_class.h:48: note:<br>
cln::cl_F::cl_F(double)<br>
../include/cln/float_class.h:47: note:<br>
cln::cl_F::cl_F(float)<br>
e.cc:281: error: no match for ?operator=? in ?w = cln::operator*(const<br>
cln::cl_R&amp;, const cln::cl_R&amp;)(((const cln::cl_R&amp;)((const cln::cl_R*)(&amp;<br>
w.cln::cl_F::&lt;anonymous&gt;))))?<br>
../include/cln/float_class.h:40: note: candidates are: cln::cl_F&amp;<br>
cln::cl_F::operator=(const cln::cl_F&amp;)<br>
../include/cln/float_class.h:47: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(float)<br>
../include/cln/float_class.h:48: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(double)<br>
e.cc:283: error: ambiguous overload for ?operator=? in ?q = 0?<br>
../include/cln/float_class.h:40: note: candidates are: cln::cl_F&amp;<br>
cln::cl_F::operator=(const cln::cl_F&amp;)<br>
../include/cln/float_class.h:47: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(float)<br>
../include/cln/float_class.h:48: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(double)<br>
e.cc:289: error: no match for ?operator=? in ?q = cln::operator*(const<br>
cln::cl_R&amp;, const cln::cl_R&amp;)(((const cln::cl_R&amp;)(&amp; cln::exp(const<br>
cln::cl_R&amp;)())))?<br>
../include/cln/float_class.h:40: note: candidates are: cln::cl_F&amp;<br>
cln::cl_F::operator=(const cln::cl_F&amp;)<br>
../include/cln/float_class.h:47: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(float)<br>
../include/cln/float_class.h:48: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(double)<br>
e.cc:294: error: conversion from ?const cln::cl_N? to non-scalar type ?bigF?<br>
requested<br>
e.cc: In function ?bigF integralH(bigF*, int, int, int, int)?:<br>
e.cc:312: error: ambiguous overload for ?operator=? in ?aa = 1?<br>
../include/cln/float_class.h:40: note: candidates are: cln::cl_F&amp;<br>
cln::cl_F::operator=(const cln::cl_F&amp;)<br>
../include/cln/float_class.h:47: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(float)<br>
../include/cln/float_class.h:48: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(double)<br>
e.cc:313: error: ambiguous overload for ?operator=? in ?b = 20?<br>
../include/cln/float_class.h:40: note: candidates are: cln::cl_F&amp;<br>
cln::cl_F::operator=(const cln::cl_F&amp;)<br>
../include/cln/float_class.h:47: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(float)<br>
../include/cln/float_class.h:48: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(double)<br>
e.cc:317: error: conversion from ?int? to ?cln::cl_F? is ambiguous<br>
../include/cln/float_class.h:38: note: candidates are:<br>
cln::cl_F::cl_F(cln::cl_anything*)<br>
../include/cln/float_class.h:26: note:                 cln::cl_F::cl_F(const<br>
char*)<br>
../include/cln/float_class.h:48: note:<br>
cln::cl_F::cl_F(double)<br>
../include/cln/float_class.h:47: note:<br>
cln::cl_F::cl_F(float)<br>
e.cc:320: error: ambiguous overload for ?operator=? in ?w = 0?<br>
../include/cln/float_class.h:40: note: candidates are: cln::cl_F&amp;<br>
cln::cl_F::operator=(const cln::cl_F&amp;)<br>
../include/cln/float_class.h:47: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(float)<br>
../include/cln/float_class.h:48: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(double)<br>
e.cc:321: error: conversion from ?int? to ?cln::cl_F? is ambiguous<br>
../include/cln/float_class.h:38: note: candidates are:<br>
cln::cl_F::cl_F(cln::cl_anything*) &lt;near match&gt;<br>
../include/cln/float_class.h:26: note:                 cln::cl_F::cl_F(const<br>
char*) &lt;near match&gt;<br>
../include/cln/float_class.h:48: note:<br>
cln::cl_F::cl_F(double)<br>
../include/cln/float_class.h:47: note:<br>
cln::cl_F::cl_F(float)<br>
e.cc: In function ?bigF integralL(bigF*, int, int, int, int)?:<br>
e.cc:339: error: ambiguous overload for ?operator=? in ?b = 1?<br>
../include/cln/float_class.h:40: note: candidates are: cln::cl_F&amp;<br>
cln::cl_F::operator=(const cln::cl_F&amp;)<br>
../include/cln/float_class.h:47: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(float)<br>
../include/cln/float_class.h:48: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(double)<br>
e.cc:346: error: ambiguous overload for ?operator=? in ?w = 0?<br>
../include/cln/float_class.h:40: note: candidates are: cln::cl_F&amp;<br>
cln::cl_F::operator=(const cln::cl_F&amp;)<br>
../include/cln/float_class.h:47: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(float)<br>
../include/cln/float_class.h:48: note:                 cln::cl_F&amp;<br>
cln::cl_F::operator=(double)<br>
make: *** [e.o] Error 1<br>
fuji:rama joshua$ make<br>
<br>
<br>
<br>
<br>
<br>
--<br>
Joshua Friedman PhD<br>
<a href="mailto:CrownEagle@gmail.com">CrownEagle@gmail.com</a><br>
<a href="http://www.math.sunysb.edu/%7Ejoshua" target="_blank">http://www.math.sunysb.edu/~joshua</a><br>
-------------- next part --------------<br>
An HTML attachment was scrubbed...<br>
URL: &lt;<a href="http://www.cebix.net/pipermail/cln-list/attachments/20100518/5dda878b/attachment-0001.htm" target="_blank">http://www.cebix.net/pipermail/cln-list/attachments/20100518/5dda878b/attachment-0001.htm</a>&gt;<br>

-------------- next part --------------<br>
A non-text attachment was scrubbed...<br>
Name: e.cc<br>
Type: application/octet-stream<br>
Size: 8206 bytes<br>
Desc: not available<br>
URL: &lt;<a href="http://www.cebix.net/pipermail/cln-list/attachments/20100518/5dda878b/attachment-0001.dll" target="_blank">http://www.cebix.net/pipermail/cln-list/attachments/20100518/5dda878b/attachment-0001.dll</a>&gt;<br>

<br>
------------------------------<br>
<br>
Message: 2<br>
Date: Tue, 18 May 2010 23:37:49 +0300<br>
From: Alexei Sheplyakov &lt;<a href="mailto:alexei.sheplyakov@gmail.com">alexei.sheplyakov@gmail.com</a>&gt;<br>
To: CLN discussion list &lt;<a href="mailto:cln-list@ginac.de">cln-list@ginac.de</a>&gt;<br>
Subject: Re: [CLN-list] confusion with cln::cl_F and cln::cl_R<br>
Message-ID: &lt;<a href="mailto:20100518203749.GA14186@vargsbox.jinr.ru">20100518203749.GA14186@vargsbox.jinr.ru</a>&gt;<br>
Content-Type: text/plain; charset=utf-8<br>
<br>
Hello,<br>
<br>
On Tue, May 18, 2010 at 11:22:25AM -0400, Joshua Friedman wrote:<br>
&gt; The program runs when I define &quot;bigF = cln_R&quot;, but I get errors when I set<br>
&gt; &quot;bigF = cln_F&quot;<br>
&gt; I found that the exponential function only gives many digits of precision<br>
&gt; when I use cln_F.<br>
&gt; I am attaching my program and the out put is below:<br>
[skipped]<br>
<br>
Here&#39;s a simpler example which illustrates the problem.<br>
<br>
$ cat noconv.cc<br>
<br>
#include &lt;cln/cln.h&gt;<br>
<br>
cln::cl_F foo(const cln::cl_F&amp; x)<br>
{<br>
        cln::cl_F one = 1;<br>
        return one;<br>
}<br>
<br>
This code won&#39;t compile because CLN does not provide implicit conversion<br>
of exact numbers (such as integers) into inexact ones (i.e. floating<br>
point ones):<br>
<br>
g++ -c noconv.cc  `pkg-config --libs --cflags cln`<br>
noconv.cc: In function ?cln::cl_F foo(const cln::cl_F&amp;)?:<br>
noconv.cc:5: error: conversion from ?int? to ?cln::cl_F? is ambiguous<br>
/home/varg/target/x86_64-linux-gnu/include/cln/float_class.h:38: note: candidates are: cln::cl_F::cl_F(cln::cl_anything*) &lt;near match&gt;<br>
/home/varg/target/x86_64-linux-gnu/include/cln/float_class.h:26: note:                 cln::cl_F::cl_F(const char*) &lt;near match&gt;<br>
/home/varg/target/x86_64-linux-gnu/include/cln/float_class.h:48: note:                 cln::cl_F::cl_F(double)<br>
/home/varg/target/x86_64-linux-gnu/include/cln/float_class.h:47: note:                 cln::cl_F::cl_F(float)<br>
<br>
<br>
One should use an appropriate cl_float function, i.e.<br>
<br>
#include &lt;cln/cln.h&gt;<br>
<br>
cln::cl_F foo(const cln::cl_F&amp; x)<br>
{<br>
        cln::cl_F one = cln::cl_float(1, x);<br>
        // Constructs a floating-point number representing 1 with the same<br>
        // mantissa size as that of x<br>
        return one;<br>
}<br>
<br>
<br>
I admit this is a bit annoying, but debugging issues due to implicit<br>
conversions is even more annoying.<br>
<br>
Best regards,<br>
        Alexei<br>
<br>
<br>
<br>
------------------------------<br>
<br>
_______________________________________________<br>
CLN-list mailing list<br>
<a href="mailto:CLN-list@ginac.de">CLN-list@ginac.de</a><br>
<a href="https://www.cebix.net/mailman/listinfo/cln-list" target="_blank">https://www.cebix.net/mailman/listinfo/cln-list</a><br>
<br>
<br>
End of CLN-list Digest, Vol 49, Issue 3<br>
***************************************<br>
</blockquote></div><br><br clear="all"><br>-- <br>Joshua Friedman PhD<br><a href="mailto:CrownEagle@gmail.com">CrownEagle@gmail.com</a><br><a href="http://www.math.sunysb.edu/~joshua">http://www.math.sunysb.edu/~joshua</a><br>