Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Discover properly negative max values #8

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

grzesiul
Copy link

In order to find maximal value in data series, 'max' should be initialized with guard value - the least possible value. Unfortunately, it's been initialized with Double.MIN_VALUE, which is positive number, so series with purely negative values are handled improperly.

Moreover, I've extracted 'effective[Min|Max]' methods to DRY code a bit and introduced similar changes - removing usages of Double.MIN_VALUE. Still, comparisons appear to be always true.

Works correctly for:

  • min: -94; max: 10; series: -93.0, -95.0, Double.MAX_VALUE, -95.0, -95.0, 20.0, 8.0, -95.0, -91.0, -(Double.MAX_VALUE - 1), -91.0, -95.0, -115.0, -92.0, -93.0, -95.0, -95.0
  • min: -94; max: -92; series: -93.0, -94.0, -95.0, -92.0

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