commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sebb <>
Subject Re: svn commit: r1062304 - /commons/proper/math/branches/MATH_2_X/src/main/java/org/apache/commons/math/util/
Date Sun, 23 Jan 2011 13:13:09 GMT
On 23 January 2011 12:35, Luc Maisonobe <> wrote:
> Hi Sebastian,
> Le 23/01/2011 13:07, sebb a écrit :
>> On 23 January 2011 11:57, sebb <> wrote:
>>> On 23 January 2011 09:58, Luc Maisonobe <> wrote:
>>>> Le 23/01/2011 01:58, a écrit :
>>>>> Author: sebb
>>>>> Date: Sun Jan 23 00:58:07 2011
>>>>> New Revision: 1062304
>>>>> URL:
>>>>> 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.


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:
For additional commands, e-mail:

View raw message