Skip to content

Fix Bug 68200 #552

Open
Tong-Huang wants to merge 2 commits into
apache:trunkfrom
Tong-Huang:fix/calculateRateError
Open

Fix Bug 68200 #552
Tong-Huang wants to merge 2 commits into
apache:trunkfrom
Tong-Huang:fix/calculateRateError

Conversation

@Tong-Huang

@Tong-Huang Tong-Huang commented Nov 23, 2023

Copy link
Copy Markdown

Hi Team,

Here some cases, calculateRate will return Double.NaN -> [#NUM!],
(https://github.com/apache/poi/blob/trunk/poi/src/main/java/org/apache/poi/ss/formula/functions/Rate.java#L99)

But it can get the right result in Numbers

case1:

RATE(22,30000,20000,-82257625,0,0.1)

Result: Double.NaN

whereas in Numbers I get: 0.35397960290713076

--

case2:

RATE(22,10000,10000,-313562750,0,0.1)

Result: Double.NaN

whereas in Numbers I get: 0.35397960290713076

Following the implementation of numpy-financial, I try to fix the bug.

https://github.com/numpy/numpy-financial/blob/d02edfb65dcdf23bd571c2cded7fcd4a0528c6af/numpy_financial/_financial.py#L582

@xzel23

xzel23 commented Nov 23, 2023

Copy link
Copy Markdown

Link to Apache POI Bug Tracker: https://bz.apache.org/bugzilla/show_bug.cgi?id=68200

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants