On 23 January 2011 12:35, Luc Maisonobe <luc.maison...@free.fr> wrote: > Hi Sebastian, > > > Le 23/01/2011 13:07, sebb a écrit : >> On 23 January 2011 11:57, sebb <seb...@gmail.com> wrote: >>> On 23 January 2011 09:58, Luc Maisonobe <luc.maison...@free.fr> wrote: >>>> Le 23/01/2011 01:58, s...@apache.org a écrit : >>>>> Author: sebb >>>>> Date: Sun Jan 23 00:58:07 2011 >>>>> New Revision: 1062304 >>>>> >>>>> URL: http://svn.apache.org/viewvc?rev=1062304&view=rev >>>>> Log: >>>>> MATH-496 Create FastMath copySign methods >>>> >>>> I was also creating these methods. >>>> I have created all the missing ones and implemented hypot directly, so >>>> don't bother doing it too. >>> >>> OK. >>> >>> I've mainly been working in Math trunk, and porting back to 2.2, so >>> I'll add your new methods back to trunk. >>> I'll also merge my fixes to nextAfter. >> >> Too late - I see you have already done this. >> >> But I also made some other (Javadoc) changes which I've not yet committed. >> >> And I'm working on changing FastMathTest to check all StrictMath >> methods (even mixed parameter ones). > > Fine. I used an hacked version of your test framework to deal with > getExponent (which returns an int) and scalb (which uses an int as > second argument). However, my hack is really ugly so I won't commit it. > I will not attempt to fix my hack and will use your updated version.
OK. I'm not promising my version will be beautiful, but I'm hoping it won't be too messy! > In my tests, I used a loop for the input integers in scalb, I needed to use > values from -2048 to +2048 to really push the system to limits (for > example going from POSITIVE_INFINITY to +0 by scaling down). > > For now, I am trying to get scalb work on all type of inputs. It is > rather tricky for subnormals as a subnormal can become a normal number > if scale factor is large and the reverse is also possible if the scale > factor is sufficiently negative. Yes, I took a look at scalb, and decided not to tackle it ... just as well the exponent is integral, or that would be even more fun! > I first tried to simply build a number of the form 2^n, but it is not > sufficient. For example it should be possible to scale Double.MIN_VALUE > up to max exponent, but in this case 2 cannot be represented as a > number, it is too large. So I have to rely on bits magics ... > > I hope I will have a reliable version of scalb in the next few hours. > > Once scalb is ready, I will also commit hypot. It is already coded and > teste, but it relies on scalb to avoid overflow/underflow (and in fact > it helps me testing scalb). Have fun! > best regards, > Luc > > >> The reflection test anyway needs to be fixed so it only allows ULP=1 >> differences in methods that are not exact. >> >>> FastMath and FastMathTest should be the same in both. >>> >>> Apart from the @since marker in FastMath - perhaps we can use @since >>> 2.2, 3.0 for that? >>> Or if that is confusing, we just need to fix one before release. --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@commons.apache.org For additional commands, e-mail: dev-h...@commons.apache.org