From: Johannes Baagoe on 15 Apr 2010 19:54 Dr J R Stockton : > When multiplying TWO ECMAScript Numbers, each of which actually > holds an integer in [0, 2^32[, trailing bits are, as you describe, > often lost. > But that is not fatal. Of course. Javascript being a Turing-complete language, it can compute *any* function that any programming language can compute. > It is only necessary to break the large numbers up into arrays of > Base- 65536 digits (16-bit) each element stored in a Number, and to do > with them Long Arithmetic such as the elderly were taught at school. > Of course, the code runs slower. That is the problem. Things like PRNGs and hash functions often need to be fast. Hence an excuse to search for solutions that are "natural" for javascript's quaint notion of numbers. Which I find useful anyway, like in learning a new natural language, e.g. Chinese - don't translate, try to *think* in it. -- Johannes
First
|
Prev
|
Pages: 1 2 3 Prev: Need help understanding javascript syntax Next: My (Your) Library: canCall |