Created
April 24, 2014 05:00
-
-
Save pzwang/11242062 to your computer and use it in GitHub Desktop.
bokeh example plot showing problems with Javascript integer precision
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import numpy as np | |
from bokeh.plotting import * | |
N = 10 | |
import sys | |
output_file("bigint.html", title="bigint example") | |
for div in (1, 10, 100, 1000, 10000, 100000, 1000000): | |
bigint = sys.maxint / 2 / div - 100 | |
x = range(bigint, bigint+10) | |
y = range(10) | |
scatter(x, y, color="blue", title="%d Digits" % len(str(bigint))) | |
xaxis().major_label_orientation = np.pi/4 | |
show() |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Things are broken beyond 15 digits.