ex to double

Volker Vogel bananabird at web.de
Wed Oct 15 13:23:23 CEST 2003


Hi,

I am a new user to ginac, and i am trying to find out how to convert an ex to a double.
This of course only makes sense when ex contains something that is a double. 
I have been searching the tutorial and tried "expresion output". 
There it explains in section 5.12.1 how to  manipulate the outputstream with 
"csrc"  but I can not get the examples working. I also dont know if this is the
right way get my double.

#include <iostream>
#include <stdio.h>

#include <ginac/ginac.h>
using namespace std;
using namespace GiNaC;

int main(){

    ex poly=2.7;
    double val;
    std::ostream & csrc(std::ostream & os);
    cout << csrc <<poly <<"\n";
    return 0;
}

When I run the example above I get the error below, and I don not know how
to handle it.

/tmp/cczNv1jd.o: In function `main':
/tmp/cczNv1jd.o(.text+0x36): undefined reference to `csrc(ostream &)'
collect2: ld returned 1 exit status

I am working wih 
ginac version : 1.1.1
g++: 2.95.3

I am not that much intro programming to understand how stream manipulation 
really works and to understand the ginac source code.
Can anyone help me to get my double ??

Saludos de España,

Volker
______________________________________________________________________________
Horoskop, Comics, VIPs, Wetter, Sport und Lotto im WEB.DE Screensaver1.2
Kostenlos downloaden: http://screensaver.web.de/?mc=021110





More information about the GiNaC-list mailing list