(x: number, y: number)
| 149 | * to work around bugs in some JS interpreters. |
| 150 | */ |
| 151 | function safe_add (x: number, y: number) |
| 152 | { |
| 153 | const lsw = (x & 0xFFFF) + (y & 0xFFFF); |
| 154 | const msw = (x >> 16) + (y >> 16) + (lsw >> 16); |
| 155 | return (msw << 16) | (lsw & 0xFFFF); |
| 156 | } |
| 157 | |
| 158 | |
| 159 | /* |