floor function for GiNaC::numeric

Richard B. Kreckel kreckel at thep.physik.uni-mainz.de
Sat Nov 11 12:35:48 CET 2000

On Sat, 11 Nov 2000, Eduardo M Kalinowski wrote:
>     I've looked through the documentation and header files for
> GiNaC::numeric and I haven't been able to find the floor (or ceil, for
> that matter) function for that class. Have I overlooked something, or is
> that missing? How can I implement one? I know CLN has a floor1 function
> that is what I want.

Of course, CLN's floor1 is only defined for the classes cl_R, cl_RA, cl_F,
cl_SF, cl_FF, cl_DF and cl_LF, not for cl_N.  You would have to make up a
definition for complex numbers or throw an exception or crash the system
or something.   ;-)

If you are interested in floor for class numeric only I would recommend
writing an ordinary function in your program, using the normal inspectors 
presented by class numeric.  Alas, it could be simpler: there is no clean
way of getting a cl_N from numeric right now, this will change in GiNaC
0.7, which in turn relies on the namespaced CLN 1.1.  I am working full
steam on getting that out of house.  Maybe two or three weeks...

Richard Kreckel
<Richard.Kreckel at Uni-Mainz.DE>

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

More information about the GiNaC-list mailing list