(a: number, b: number)
| 61 | } |
| 62 | |
| 63 | function add32to64(a: number, b: number): [number, number] { |
| 64 | const low = (a & 0xffff) + (b & 0xffff); |
| 65 | const high = (a >>> 16) + (b >>> 16) + (low >>> 16); |
| 66 | return [high >>> 16, (high << 16) | (low & 0xffff)]; |
| 67 | } |
| 68 | |
| 69 | function add64([ah, al]: [number, number], [bh, bl]: [number, number]): [number, number] { |
| 70 | const [carry, l] = add32to64(al, bl); |