# Will use of a new 64 bit OS increase precision od JS mathcalculations?

C

#### cwdjrxyz

I am having a new computer built with the necessary speed and memory
to work with Blu-ray discs efficiently. It will use an Intel Core i7
processor, 6GB(expandable to 24) of Tri-Channel DDR3 SDRAM at 1066 MHz
memory, and 1TB of Data Security Raid1(2 x 1TB Sata 7200 rpm HDs). It
will have a 64 bit OS. Will current javascript math calculations be
rounded off to what you get with a 32 bit system, or will you get full
advantage of the increased 64 bit word size? This system at least
likely will greatly speed up long script math calculations.

D

#### Doug Gunnoe

I am having a new computer built with the necessary speed and memory
to work with Blu-ray discs efficiently. It will use an Intel Core i7
processor, 6GB(expandable to 24) of Tri-Channel DDR3 SDRAM at 1066 MHz
memory, and 1TB of Data Security Raid1(2 x 1TB Sata 7200 rpm HDs). It
will have a 64 bit OS. Will current javascript math calculations be
rounded off to what you get with a 32 bit system, or will you get full
advantage of the increased 64 bit word size? This system at least
likely will greatly speed up long script math calculations.

The FAQ says:

ECMAScript numbers are represented in binary as IEEE-754 (IEC 559)
Doubles, with a resolution of 53 bits, giving an accuracy of 15-16
decimal digits; integers up to just over 9e15 are precise, but few
decimal fractions are. Given this, arithmetic is as exact as possible,
but no more. Operations on integers are exact if the true result and
all intermediates are integers within that range.

http://jibbering.com/faq/index.html#binaryNumbers
also
http://en.wikipedia.org/wiki/IEEE_754#Basic_formats

If you ran a 32 bit JavaScript engine on a 64 bit system, I don't know
if it would speed up at all, right?

But If your browser is made for a 64 bit system, maybe so. I just
don't see how they're could be much of a benefit in speed otherwise.

And I would think as long as 64 bit systems have been on the market
that this wouldn't be an issue, so never mind I guess.

T

#### Thomas 'PointedEars' Lahn

cwdjrxyz said:
I am having a new computer built with the necessary speed and memory
to work with Blu-ray discs efficiently. It will use an Intel Core i7
processor, 6GB(expandable to 24) of Tri-Channel DDR3 SDRAM at 1066 MHz
memory, and 1TB of Data Security Raid1(2 x 1TB Sata 7200 rpm HDs). It
will have a 64 bit OS. Will current javascript math calculations be
rounded off to what you get with a 32 bit system, or will you get full
advantage of the increased 64 bit word size? This system at least
likely will greatly speed up long script math calculations.

Values of the ECMAScript Number type are always 64 bit wide in memory (52
mantissa bits, 11 exponent bits, 1 sign bit), no matter the rounding:

,-[ECMAScript Language Specification, Edition 3 Final]
|
| 8.5 The Number Type
|
| The Number type has exactly 18437736874454810627 (that is, 2^64 âˆ’ 2^53
| + 3) values, representing the double-precision 64-bit format IEEE 754
| values as specified in the IEEE Standard for Binary Floating-Point
| Arithmetic, except that the 9007199254740990 (that is, 2^53 âˆ’ 2) distinct
| â€œNot-a-Numberâ€ values of the IEEE Standard are represented in ECMAScript
| as a single special NaN value. [...]

Which is probably why my Magic 8-Ball says:

Probably yes

You might be confused as to the values that can be stored because the string
representation of Number values has usually less precision than what can be
stored. In that case, it should hardly matter whether it is a 32-bit or
64-bit CPU; it is the ECMAScript implementation (here probably: in the HTML
user agent) and its implementation of the string representation that counts.

RTFM, RTFFAQ, STFW: <http://jibbering.com/faq/>

PointedEars