> <\body> interface> Floating point numbers of arbitrarily large size are available through the class |mmx::floating> defined in |numerix/floating.hpp>. This class is a simple wrapper to the class of the |http://www.mpfr.org> library. <\cpp-code> #include\numerix/floating.hpp\ using namespace mmx; void main () { \ \ floating\\ a (2), b (3); \ \ mmout \\ a * b \\ "\\n"; } The precision can be set thanks to the global variable . Lower and upper certified approximates can be obtained as follows: <\cpp-code> typedef rounding_helper\floating\\ \::UV Up; typedef rounding_helper\floating\\ \::DV Down; mmout \\ Up::sqrt (floating\\ (2)) \\ "\\n"; mmout \\ Down::sqrt (floating\\ (2)) \\ "\\n"; interface> The above floating type is glued to as . Default bit-precision can be modified by setting the variable . <\session|mathemagix|default> <\input> <|input> use "numerix"; type_mode? := true; <\unfolded-io> <|unfolded-io> a: Floating == 1.0 <|unfolded-io> : <\unfolded-io> <|unfolded-io> exp a <|unfolded-io> : <\unfolded-io> <|unfolded-io> sin a <|unfolded-io> : <\unfolded-io> <|unfolded-io> 1 / 0.0 <|unfolded-io> >: <\unfolded-io> <|unfolded-io> bit_precision := 128 <|unfolded-io> : <\unfolded-io> <|unfolded-io> exp 1.0 <|unfolded-io> : interface> Interval are implemented within the class |mmx::interval> defined in |numerix/interval.hpp>. <\cpp-code> #include\numerix/floating.hpp\ #include\numerix/interval.hpp\ using namespace mmx; typedef interval\floating\\ \ Interval; void main () { \ \ Interval a (2), b (3.0, 3.1); \ \ mmout \\ a * b \\ "\\n"; } interface> The above interval type is glued to as . Classical scientific notation are used for pretty printing intervals. <\session|mathemagix|default> <\unfolded-io> <|unfolded-io> a == interval (0.999, 1) <|unfolded-io> : > <\unfolded-io> <|unfolded-io> exp a <|unfolded-io> : > <\unfolded-io> <|unfolded-io> radius a <|unfolded-io> : <\unfolded-io> <|unfolded-io> lower a <|unfolded-io> : <\unfolded-io> <|unfolded-io> upper a <|unfolded-io> : interface> Complex numbers are available through the class |mmx::complex> defined in |numerix/complex.hpp>. Over one must include . <\cpp-code> #include\numerix/complex_double.hpp\ using namespace mmx; typedef complex\double\ Complex; void main () { \ \ Complex a (2), b (3.0, 0.1); \ \ mmout \\ a * b \\ "\\n"; } interface> The above complex type is glued to as . <\session|mathemagix|default> <\unfolded-io> <|unfolded-io> I == complex (0, 1) <|unfolded-io> >: > <\unfolded-io> <|unfolded-io> I * I <|unfolded-io> : > <\unfolded-io> <|unfolded-io> 1 / (1 + I) <|unfolded-io> -*\>: > <\unfolded-io> <|unfolded-io> I == complex (0 :\ Floating, 1 :\ Floating) <|unfolded-io> >: > <\unfolded-io> <|unfolded-io> exp I <|unfolded-io> >: > interface> Balls are implemented in the class |mmx::ball> defined in |numerix/ball.hpp>. <\cpp-code> #include\numerix/ball.hpp\ using namespace mmx; typedef ball\floating\\ \ Ball; void main () { \ \ Ball a (2), b (3.0, 0.1); \ \ mmout \\ a * b \\ "\\n"; } interface> The above ball type is glued to as . <\session|mathemagix|default> <\unfolded-io> <|unfolded-io> a : Ball (Floating, Floating) == ball (3.0, 0.1) <|unfolded-io> <\unfolded-io> <|unfolded-io> [ center a, radius a ] <|unfolded-io> > <\input> <|input> M (n) == \ \ if n = 0 then ball 2.0 \ \ else if n = 1 then ball (-4.0) \ \ else 111 - 1130 / M (n-1) + 3000 / (M(n-1) * M(n-2)); <\unfolded-io> <|unfolded-io> for n in 1 .. 15 do \ \ mmout \\ n \\ " " \\ M n \\ lf; <|unfolded-io> . If you don't have this file, write to the Free Software Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.> <\initial> <\collection>