[Maxima] Fwd: [Ecls-list] ECL now rounds rationals

Robert Dodier robert.dodier at gmail.com
Mon Dec 7 11:21:47 CST 2009


I think has some bearing on failed tests in the Maxima test suite.

Robert Dodier


---------- Forwarded message ----------
From: Juan Jose Garcia-Ripoll <juanjose.garciaripoll at googlemail.com>
Date: Fri, Dec 4, 2009 at 5:50 PM
Subject: [Ecls-list] ECL now rounds rationals
To: list-ecl <ecls-list at lists.sourceforge.net>


* Visible changes:

 - When converting rationals to floats, ECL now rounds instead of using the
  routine in GMP, which truncates.

(loop for type in '(short-float single-float double-float long-float)
      for i from 60 to 70
      nconc (loop with value = (ash 1 i)
               with expected = (coerce 1 type)
               for j from 0 to 10
               for x = (- value j)
               for r = (/ (1- x) x)
               for f1 = (coerce r type)
               for f2 = (- (coerce (- r) type))
               unless (and (= f1 expected) (= f2 expected))
               collect r))

=> NIL

Before it produced a list of rationals it failed to round.

--
Instituto de Física Fundamental, CSIC
c/ Serrano, 113b, Madrid 28006 (Spain)
http://juanjose.garciaripoll.googlepages.com

------------------------------------------------------------------------------
Join us December 9, 2009 for the Red Hat Virtual Experience,
a free event focused on virtualization and cloud computing.
Attend in-depth sessions from your desk. Your couch. Anywhere.
http://p.sf.net/sfu/redhat-sfdev2dev
_______________________________________________
Ecls-list mailing list
Ecls-list at lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ecls-list



More information about the Maxima mailing list