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

Allow zero probability #4

Merged
merged 1 commit into from Oct 10, 2017
Merged

Conversation

arve0
Copy link
Contributor

@arve0 arve0 commented Oct 8, 2017

This allows for:

picker.option('name', 0)

Might also want to look into the logic here:

if (!Number.isFinite(num) || num < 0) {
  num = 0;
}

If a number is infinity, one would not want the probability to be zero.

Fixes issue #3

This allows for:

```js
picker.option('name', 0)
```

Might also want to look into the logic here:

```js
if (!Number.isFinite(num) || num < 0) {
  num = 0;
}
```

If a number is infinity, one would not want the probability to be zero.

Fixes issue skratchdot#3
@coveralls
Copy link

coveralls commented Oct 8, 2017

Coverage Status

Coverage remained the same at 100.0% when pulling d98b5a2 on arve0:zero-probability into a36f79c on skratchdot:master.

@skratchdot
Copy link
Owner

Thank you for this! I need to look through the code and document what is expected when non-numbers are passed as the score (as well as negative numbers and zero). This probably wasn't the most well thought out api, but it worked for my use-case. I'll merge this PR soon.

@skratchdot skratchdot merged commit e777887 into skratchdot:master Oct 10, 2017
@skratchdot
Copy link
Owner

I published this as v1.0.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.

None yet

3 participants