| Blockland Forums > Modification Help |
| [Resource] Unsigned Integer - Safe arithmetic operators |
| (1/1) |
| mctwist:
Due to how TorqueScript works, arithmetic operators break integers for any value equal or bigger one million. It automatically transforms into a floating operator that makes it impossible to do calculations on. Port made his own addition and subtraction and everyone was happy. However, I found myself in need of both multiplication and division. And why stop there and try to recreate the wheel when I found a rather quick unsigned integer addition made in JavaScript, so I ported it and then made my own version on the subtraction(Basically the same thing, but with recursion). Unsigned Integer I even put it to the test by adding it to sha256 with great results, up to 40% performance boost. |
| Navigation |
| Message Index |