Bug in conversions in RC3 [message #900047] |
Fri, 03 August 2012 12:02  |
Eclipse User |
|
|
|
Using rc3, unit conversions appear to lose precision as illustrated below.
LengthAmount x = new LengthAmount(1.0001, SI.Prefix.KILO(SI.METRE));
IMeasure<Length> xi = x.to(SI.METRE);
System.out.println("x="+x+" xi="+xi);
// Results in: x=1.0001 km xi=1000.0 m
This is a pretty basic feature and, if it is really broken, then rc3 isn't usable.
Has this been fixed since RC3? If so can this be released? Or can the jars (and source jars) be made available somewhere? We are only using units and core jars and it seems excessive to have to get the eclipse build environment working.
|
|
|
Re: Bug in conversions in RC3 [message #902617 is a reply to message #900047] |
Sat, 18 August 2012 14:11   |
Eclipse User |
|
|
|
Thanks a lot for spotting that.
Could you create a Bugzilla entry if you have a working account for that?
If I don't find it soon, I may convert your forum post into a Bugzillla
ticket myself.
And try reproduce, beside covering a Unit Test for that once it can be
solved.
The only way to build UOMo at the moment is by using Tycho and include ICU4J
beside its (still relatively few;-) dependencies.
There are alternate Unit-API implementations, especially JScience 5 on their
way which use a slightly differrent stack. Since unit systems like SI
largely depend on implementations of the Unit and Quantity core types, those
will most likely remain implementation dependent.
As soon as Java Standards especially JSR 354 or 310 become available and
mature, there could be different implementations at least for UOMo Business,
but at the moment, the ICU stack is the best to use on the Java Platform.
Regards,
Werner
"Brent Clark" <forums-noreply@xxxxxxxx> schrieb im Newsbeitrag
news:jvgsmr$1tg$1@xxxxxxxxe.org...
> Using rc3, unit conversions appear to lose precision as illustrated below.
> LengthAmount x = new LengthAmount(1.0001, SI.Prefix.KILO(SI.METRE));
> IMeasure<Length> xi = x.to(SI.METRE);
> System.out.println("x="+x+" xi="+xi);
> // Results in: x=1.0001 km xi=1000.0 m
>
> This is a pretty basic feature and, if it is really broken, then rc3 isn't
> usable.
>
> Has this been fixed since RC3? If so can this be released? Or can the jars
> (and source jars) be made available somewhere? We are only using units and
> core jars and it seems excessive to have to get the eclipse build
> environment working.
>
|
|
|
|
Re: Bug in conversions in RC3 [message #902619 is a reply to message #902617] |
Sat, 18 August 2012 15:28  |
Eclipse User |
|
|
|
See Bugzilla, it's been fixed already. May need some unit tests (anybody
more than welcome to contribute tests;-) but the actual problem is resolved.
Should go into RC4, as soon as Unit-API makes its way into Orbit we're
hoping to have a Milestone Release 0.6 out, too.
Thanks for the help
|
|
|
Powered by
FUDForum. Page generated in 0.09153 seconds