Issue Details (XML | Word | Printable)

Type: Bug Bug
Status: Open Open
Priority: Blocker Blocker
Assignee: jscience-issues
Reporter: shanmann
Votes: 0
Watchers: 0

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

Amount.root(n) for odd roots (n) does not work for negative values

Created: 08/Oct/07 02:06 PM   Updated: 31/Jan/11 02:48 AM
Component/s: www
Affects Version/s: current
Fix Version/s: Version 6.0

Time Tracking:
Not Specified

File Attachments: 1. Java Source File (1 kB) 08/Oct/07 02:07 PM - shanmann


Operating System: All
Platform: All

Issuezilla Id: 65
Participants: jscience-issues and shanmann

 Description  « Hide

The Amount.root(int n) method for odd roots does not work for negative values.

For example Amount.valueOf( -8, SI.METRE.pow(3) ).root( 3 ) should result in an
Amount of "-2 m". However, it actually returns an amount with a value of NaN.

I will attach a small JUnit test for a few odd root cases.