Issue Details (XML | Word | Printable)

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

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

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 AmountOddRootOfNegativeValueTest.java (1 kB) 08/Oct/07 02:07 PM - shanmann

Environment:

Operating System: All
Platform: All


Issuezilla Id: 65
Tags:
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.