Issue Details (XML | Word | Printable)

Key: JSCIENCE-168
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: jazeee
Votes: 0
Watchers: 0
Operations

If you were logged in you would be able to see more operations.
jscience

AmountFormat does not return correct value when using getExactDigitsInstance

Created: 05/Jun/13 09:25 PM   Updated: 05/Jun/13 09:25 PM
Component/s: Mathematics
Affects Version/s: current
Fix Version/s: None

Time Tracking:
Not Specified

Tags:
Participants: jazeee


 Description  « Hide

The following works:
System.out.println(Amount.valueOf(0.001, (NonSI.LITER)).to(SI.MILLI(NonSI.LITER)));

Returns (0.9999999999999998 ± 1.7E-16) mL (Or effectively, 1mL)

The following doesn't work correctly:

AmountFormat.setInstance(AmountFormat.getExactDigitsInstance());
System.out.println(Amount.valueOf(0.001, (NonSI.LITER)).to(SI.MILLI(NonSI.LITER)));
Returns 0.100000000000000 mL

This may be related to JSCIENCE-138



There are no comments yet on this issue.