Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » UOMo » Bug in conversions in RC3(Bug inconversions in RC3)
Bug in conversions in RC3 [message #900047] Fri, 03 August 2012 16:02 Go to next message
Brent Clark is currently offline Brent ClarkFriend
Messages: 1
Registered: August 2012
Junior Member
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 18:11 Go to previous messageGo to next message
Werner Keil is currently offline Werner KeilFriend
Messages: 1087
Registered: July 2009
Senior Member
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 #902618 is a reply to message #902617] Sat, 18 August 2012 19:02 Go to previous messageGo to next message
Werner Keil is currently offline Werner KeilFriend
Messages: 1087
Registered: July 2009
Senior Member
Ok, there's a Bugzilla entry now:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=387540

Please if you have any input, or patches, try adding to this issue instead.

Thanks
Re: Bug in conversions in RC3 [message #902619 is a reply to message #902617] Sat, 18 August 2012 19:28 Go to previous message
Werner Keil is currently offline Werner KeilFriend
Messages: 1087
Registered: July 2009
Senior Member
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
Previous Topic:DemoCamps Juno 2012
Next Topic:UOMo Moments at JavaOne Embedded
Goto Forum:
  


Current Time: Fri Apr 26 12:26:28 GMT 2024

Powered by FUDForum. Page generated in 0.03701 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top