Equivalent of evalf for numeric (for fractions)

Eduardo M Kalinowski ekalin at iname.com
Wed Dec 6 17:32:07 CET 2000


"Richard B. Kreckel" wrote:

> On Mon, 4 Dec 2000, Eduardo M Kalinowski wrote:
> >     How can I convert a GiNaC::numeric that contains a fraction (or even
> > a integer, for that matter) into a numeric with the real representation
> > of the fraction? Currently I'm adding "0.0" to the numeric to force it
> > into a real number. This works, but is ugly. How about an "evalf"
> > function for GiNaC::numeric?
>
> This is exactly why GiNaC::numeric has a method "evalf" and internally it
> is doing exactly what you are suggesting.    :-)

You're right, there is, but it returns an ex, not a numeric. I cannot think of a
possibility in which the result of evalf on a numeric could not be represented
by another numeric, and needs an ex. Anyway, this leads to one other question I
would eventually have to ask, which is in the next message.


--
It's from Casablanca.  I've been waiting all my life to use that line.
                -- Woody Allen, "Play It Again, Sam"

Eduardo M Kalinowski     (ekalin at iname.com)
http://move.to/hpkb      http://cami-ufpr.hpg.com.br




-
To UNSUBSCRIBE, email to ginac-list at ginac.de with a subject of "unsubscribe".



More information about the GiNaC-list mailing list