# Just Launched: You can now import projects and releases from Google Code onto SourceForge

We are excited to release new functionality to enable a 1-click import from Google Code onto the Allura platform on SourceForge. You can import tickets, wikis, source, releases, and more with a few simple steps.

## reduce-algebra-developers

 [Reduce-algebra-developers] Rounding odd when pri off From: Simon Weitzhofer - 2011-07-19 13:09:33 ```Hello, my name is Simon Weitzhofer and I'm working on the GeoGebra project (www.geogebra.org), a educational mathematic software. We are going to use the java version of reduce for the next version of GeoGebra and now I ran into a problem with expanding an expression. The goal is to expand the term 1.2*x*(x+1). The expected result is 1.2*x^2+1.2*x. With switch pri set to on the result is 1.2*x*(x + 1), with switch pri off the result is (:rd: . 1.2)*x^2 + (:rd: . 1.2)*x. (rounded is set to on and roundall, numval to off). Any idea how to get rid of the :rd: thing or another way to expand this expression? Thank you, Simon ```
 Re: [Reduce-algebra-developers] Rounding odd when pri off From: Rainer Schöpf - 2011-07-19 14:29:07 ```On Tue, 19 Jul 2011 at 14:47 +0200, Simon Weitzhofer wrote: > my name is Simon Weitzhofer and I'm working on the GeoGebra project > (www.geogebra.org), a educational mathematic software. We are going to use > the java version of reduce for the next version of GeoGebra and now I ran > into a problem with expanding an expression. > > The goal is to expand the term 1.2*x*(x+1). The expected result is > 1.2*x^2+1.2*x. With switch pri set to on the result is 1.2*x*(x + 1), with > switch pri off the result is (:rd: . 1.2)*x^2 + (:rd: . 1.2)*x. (rounded is > set to on and roundall, numval to off). > Any idea how to get rid of the :rd: thing or another way to expand this > expression? (:rd: . 1.2) is the internal representation of the rounded number 1.2. The expression is expanded correctly, but printed incorrectly, ie. it is a bug in the part of the printer that is exercised when the switch pri is off. I have a preliminary correction for this; it isn't really tested right now, but apparently solves your problem. Redefine the procedure xprint as symbolic procedure xprint(u,flg); % U is a standard term. % Flg is a flag which is true if a term has preceded this term. % Procedure prints the term and returns NIL. begin scalar v,w; v := tc u; u := tpow u; if (w := kernlp v) and w neq 1 then <>>>; if flg then oprin 'plus; if w and w neq 1 then <>; xprinp u; if v neq 1 then <> end; by adding this code to your input. I will test this further before committing the update. (To other developers: given that the value of variable w can be an arbitrary domain element, shouldn't the comparisons of w to 1 better be done by calling !:onep on it?) Regards, Rainer ```
 Re: [Reduce-algebra-developers] Rounding odd when pri off From: Ted Kosan - 2011-07-22 21:39:29 ```Rainer wrote: >> (:rd: . 1.2) is the internal representation of the rounded number 1.2. The >> expression is expanded correctly, but printed incorrectly, ie. it is a bug in >> the part of the printer that is exercised when the switch pri is off. > > I have a preliminary correction for this; it isn't really tested right now, but > apparently solves your problem.  Redefine the procedure xprint as > > symbolic procedure xprint(u,flg); >   % U is a standard term. >   % Flg is a flag which is true if a term has preceded this term. >   % Procedure prints the term and returns NIL. >   begin scalar v,w; >      v := tc u; >      u := tpow u; >      if (w := kernlp v) and w neq 1 >        then <               if minusf w >                 then <>>>; >      if flg then oprin 'plus; >      if w and w neq 1 >        then <>; >      xprinp u; >      if v neq 1 then <> >   end; > > by adding this code to your input. > > I will test this further before committing the update. Thank you very much for coming up with a solution to this problem. Ted ```
 Re: [Reduce-algebra-developers] Rounding odd when pri off From: Rainer Schöpf - 2011-07-21 16:21:30 ```Hello Simon, concerning the problem you reported two days ago: > The goal is to expand the term 1.2*x*(x+1). The expected result is 1.2*x^2+1.2*x. > With switch pri set to on the result is 1.2*x*(x + 1), with switch pri off the result is (:rd: . 1.2)*x^2 + (:rd: . 1.2)*x. > (rounded is set to on and roundall, numval to off). I checked in a correction and confirmed that a freshly built Java version of REDUCE does no longer exhibit the problem. Rainer ```