<html>
<body>
I've started experimenting with CLN; I'm developing with Xcode 2 on Mac
OS X 10.4. The library and my code both build fine, but when I run my
test program, I get this:<br><br>
<font face="Helvetica, Helvetica">[Session started at 2005-05-05 20:05:51
-0400.]<br>
ZeroLink: unknown symbol '__ZN3cln15cl_class_fixnumE'<br><br>
Euclid has exited due to signal 6 (SIGABRT).<br><br>
<br>
Here's my code:<br><br>
</font><font face="Courier New, Courier" color="#683821">#include
<cln/integer.h><br>
#include <cln/real.h><br>
#include <cln/complex.h><br>
#include "cln_misc.h"<br><br>
</font><font face="Courier New, Courier" color="#760F50">using</font>
<font face="Courier New, Courier">
</font><font face="Courier New, Courier" color="#760F50">namespace</font>
<font face="Courier New, Courier"> cln;<br><br>
</font><font face="Courier New, Courier" color="#760F50">const</font>
<font face="Courier New, Courier"> cl_I
fibonacci(</font><font face="Courier New, Courier" color="#760F50">
int</font><font face="Courier New, Courier">);<br>
</font><font face="Courier New, Courier" color="#760F50">const</font>
<font face="Courier New, Courier"> cl_R gamma(cl_R);<br>
</font><font face="Courier New, Courier" color="#760F50">const</font>
<font face="Courier New, Courier"> cl_R gamma(cl_RA);<br><br>
float_format_t iprec =
float_format(</font><font face="Courier New, Courier" color="#0000FF">
500</font><font face="Courier New, Courier">);<br><br>
</font><font face="Courier New, Courier" color="#760F50">int</font>
<font face="Courier New, Courier"> main() {<br>
</font><font face="Courier New, Courier" color="#236E25">//<x-tab>
</x-tab>cl_I ret =
fibonacci(17);<br>
</font><font face="Courier New, Courier"><x-tab>
</x-tab><br>
<x-tab> </x-tab></font>
<font face="Courier New, Courier" color="#760F50">return</font>
<font face="Courier New, Courier">
</font><font face="Courier New, Courier" color="#0000FF">0</font>
<font face="Courier New, Courier">;<br>
}<br><br>
</font><font face="Courier New, Courier" color="#236E25">// Returns F_n,
computed as the nearest integer to<br>
// ((1+sqrt(5))/2)^n/sqrt(5). Assume n>=0.<br>
</font><font face="Courier New, Courier" color="#760F50">const</font>
<font face="Courier New, Courier"> cl_I fibonacci
(</font><font face="Courier New, Courier" color="#760F50">int</font>
<font face="Courier New, Courier"> n)<br>
{<br>
</font><font face="Courier New, Courier" color="#236E25">// Need a
precision of ((1+sqrt(5))/2)^-n.<br>
</font><font face="Courier New, Courier">
float_format_t prec =
float_format((</font><font face="Courier New, Courier" color="#760F50">
int</font><font face="Courier New, Courier">)(</font>
<font face="Courier New, Courier" color="#0000FF">0.208987641</font>
<font face="Courier New, Courier">*n</font>
<font face="Courier New, Courier" color="#0000FF">+5</font>
<font face="Courier New, Courier">));<br>
cl_R sqrt5 =
sqrt(cl_float(</font><font face="Courier New, Courier" color="#0000FF">
5</font><font face="Courier New, Courier">,prec));<br>
cl_R phi =
(</font><font face="Courier New, Courier" color="#0000FF">1</font>
<font face="Courier New, Courier">+sqrt5)/</font>
<font face="Courier New, Courier" color="#0000FF">2</font>
<font face="Courier New, Courier">;<br>
</font><font face="Courier New, Courier" color="#760F50">return</font>
<font face="Courier New, Courier"> round1( expt(phi,n)/sqrt5 );<br>
}<br><br>
</font><font face="Courier New, Courier" color="#760F50">const</font>
<font face="Courier New, Courier"> cl_R gamma(cl_R src)<br>
{<br>
<x-tab> </x-tab>cl_R *ret
=
</font><font face="Courier New, Courier" color="#760F50">new</font>
<font face="Courier New, Courier"> cl_R();<br>
<x-tab> </x-tab>cl_R
deltax;<br>
<x-tab> </x-tab>cl_R
x_k;<br>
<x-tab> </x-tab><br>
<x-tab> </x-tab></font>
<font face="Courier New, Courier" color="#760F50">for</font>
<font face="Courier New, Courier">
(</font><font face="Courier New, Courier" color="#760F50">int</font>
<font face="Courier New, Courier"> i =
</font><font face="Courier New, Courier" color="#0000FF">0</font>
<font face="Courier New, Courier">; i < iprec; i++) <br>
<x-tab> </x-tab>{<br>
<x-tab> </x-tab><x-tab>
</x-tab>x_k = x_k +
deltax;<br>
<x-tab> </x-tab><x-tab>
</x-tab>*ret =
expt(ln(x_k), src);<br>
<x-tab> </x-tab>}<br>
<x-tab> </x-tab><br>
<x-tab> </x-tab>*ret =
*ret * deltax;<br>
<x-tab> </x-tab><br>
<x-tab> </x-tab></font>
<font face="Courier New, Courier" color="#760F50">return</font>
<font face="Courier New, Courier"> *ret;<br>
}<br><br>
</font><font face="Courier New, Courier" color="#760F50">const</font>
<font face="Courier New, Courier"> cl_R gamma(cl_RA src)<br>
{<br>
<x-tab> </x-tab>cl_R pass
= (cl_R)src;<br>
<x-tab> </x-tab></font>
<font face="Courier New, Courier" color="#760F50">return</font>
<font face="Courier New, Courier"> gamma(pass);<br>
}<br>
</font></body>
</html>