J
J.Sperlhofer
Good morning, Javascript-Professionals.
I'm looking for an possibility to show a (calculated) 64bit-Number
without exponential notation. I don't want to see exponational notation
within my binary numbers.
To demonstrate my problem, try this code:
----
var binNumber = Math.pow(2,61);
document.getElementById("inputbox").value = binNumber.toString(2);
----
It shows "1(e+61)" instead of
"10000000000000000000000000000000000000000000000000000000000000".
My codesnippet works great for powers of 2 below 61, but it starts with
the exponantial notation at powers of 61.
I looked around the web but i couldn't find a solution, just the
information that "javascript returns exponential notation in all
browsers outside the boundaries of 1e-5 and 1e+15)" (taken from the
JavaScript Core Language Reference, Part IV) - which is actually wrong
in the scope of binary digits.
Is there a simple (but fast) solution for my problem, or a switch to
turn off the exponential Notation?
Any help would be greatly appreciated.
Sincerely, J.Sperlhofer
I'm looking for an possibility to show a (calculated) 64bit-Number
without exponential notation. I don't want to see exponational notation
within my binary numbers.
To demonstrate my problem, try this code:
----
var binNumber = Math.pow(2,61);
document.getElementById("inputbox").value = binNumber.toString(2);
----
It shows "1(e+61)" instead of
"10000000000000000000000000000000000000000000000000000000000000".
My codesnippet works great for powers of 2 below 61, but it starts with
the exponantial notation at powers of 61.
I looked around the web but i couldn't find a solution, just the
information that "javascript returns exponential notation in all
browsers outside the boundaries of 1e-5 and 1e+15)" (taken from the
JavaScript Core Language Reference, Part IV) - which is actually wrong
in the scope of binary digits.
Is there a simple (but fast) solution for my problem, or a switch to
turn off the exponential Notation?
Any help would be greatly appreciated.
Sincerely, J.Sperlhofer