"Richard B. Kreckel" wrote:
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. ;-)
I know, what I tought was of using that on the internal representation... but I see its not possible. About complex numbers, there error checking against that before the place where the hypotetical floor would be called.
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...
Has cln-1.1 been already released? Well, if it is two or three weeks (or more, if we consider Murhpy's Law), then I probably can wait. -- How much does it cost to entice a dope-smoking UNIX system guru to Dayton? -- Brian Boyle, UNIX/WORLD's First Annual Salary Survey Eduardo M Kalinowski (ekalin@iname.com) http://move.to/hpkb http://cami-ufpr.hpg.com.br - To UNSUBSCRIBE, email to ginac-list@ginac.de with a subject of "unsubscribe".