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

[bugfix] bignumber comparison wrong with neg values #1743

Merged
merged 2 commits into from
Dec 4, 2016

Conversation

mistercrunch
Copy link
Member

Tested that the example slices renders properly.

@@ -35,7 +35,8 @@ function bigNumberVis(slice) {
if (json.compare_lag > 0) {
const pos = data.length - (json.compare_lag + 1);
if (pos >= 0) {
vCompare = (v / data[pos][1]) - 1;
const vAnchor = data[pos][1];
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

can vAnchor be a 0 ?

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes....vAnchor is basically a data point- If there is no check over data[pos][1], then this could lead to arithmetic exception.

Copy link

@opensorcerer-95 opensorcerer-95 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

And what of the case if it is zero......does it not make more sense to divide by 1 - otherwise it will lead to data loss everytime vAnchor comes out to be zero

@mistercrunch
Copy link
Member Author

Avoiding the zero division, currently it just won't show that section if that's the case.

@mistercrunch mistercrunch merged commit a3106bc into apache:master Dec 4, 2016
@mistercrunch mistercrunch added 🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.15.0 labels Feb 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🏷️ bot A label used by `supersetbot` to keep track of which PR where auto-tagged with release labels 🚢 0.15.0
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants