Created
September 2, 2017 06:06
-
-
Save alexcrichton/c49d960f631fcb78e1fcb53c79e8fe91 to your computer and use it in GitHub Desktop.
This file contains 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
function out(arg) { | |
document.getElementById('output').innerHTML += arg + "\n"; | |
} | |
function test(a, ty) { | |
a[0] = 257.0; | |
out(' 257.0 -> ' + ty + ' = ' + a[0]); | |
a[0] = -257.0; | |
out('-257.0 -> ' + ty + ' = ' + a[0]); | |
a[0] = 2147483648.0; | |
out(' MAX+1 -> ' + ty + ' = ' + a[0]); | |
a[0] = -2147483649.0; | |
out(' MIN-1 -> ' + ty + ' = ' + a[0]); | |
a[0] = -0.0; | |
out('-0.0 -> ' + ty + ' = ' + a[0]); | |
a[0] = 1.0/0.0; | |
out(' Inf -> ' + ty + ' = ' + a[0]); | |
a[0] = -1.0/0.0; | |
out('-Inf -> ' + ty + ' = ' + a[0]); | |
a[0] = 0.0/0.0; | |
out(' NaN -> ' + ty + ' = ' + a[0]); | |
} | |
test(new Int32Array(1), 'i32'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment