Skip to content

Misleading range of input in reducePayneHanek() in FastMath.java of util package#111

Closed
Kakarot-SSJ4 wants to merge 3 commits intoapache:masterfrom
Kakarot-SSJ4:fix-doc
Closed

Misleading range of input in reducePayneHanek() in FastMath.java of util package#111
Kakarot-SSJ4 wants to merge 3 commits intoapache:masterfrom
Kakarot-SSJ4:fix-doc

Conversation

@Kakarot-SSJ4
Copy link

The documentation says: This is good for all inputs 0.0 < x < inf

However, if we look at the implementation, the variable idx will be evaluated to a negative value for the range 0.0 <= x < 0.5., which will throw ArrayIndexOutOfBoundsException.

Hence, the range should be 0.5 <= x < inf.

For example:
If x = 0.4,
idx = -1

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.

1 participant