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

Fixed Number.k() bug #35

Merged
merged 1 commit into from
Jul 23, 2017
Merged

Conversation

jmariner
Copy link
Contributor

When the result of Number.k() was a one-item array, that one item was a Number object instead of an ordinary number. This breaks code that checks for an item's existence in the array. For example, 2k ø2, which checks if the number 2 exists in the array of factors of 2, returns false when it should return true.

Example in Chrome dev console
Example

This was fixed similarly to how I see you handling some other Number functions: by casting the Number object to an ordinary number by using +this.

When the result of Number.k() was a one-item array, that one item was a Number object instead of an ordinary number. This breaks code that checks for an item's existence in the array. For example, "2k ø2", which checks if the number 2 exists in the array of factors of 2, returns false when it should return true.

Example in Chrome dev console: http://i.imgur.com/4NawhOk.png

This was fixed similarly to how I see you handling some other Number functions: by casting the Number object to an ordinary number by using "+this".
@ETHproductions ETHproductions merged commit 0fd097c into ETHproductions:master Jul 23, 2017
@ETHproductions
Copy link
Owner

Thanks! I realized at some point in the past that you have to be really careful to cast this to a number before doing anything with it, but I guess I missed it there.

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