| Crates.io | bobcat-maths |
| lib.rs | bobcat-maths |
| version | 0.7.19 |
| created_at | 2025-10-13 07:20:43.879386+00 |
| updated_at | 2026-01-23 10:08:37.170303+00 |
| description | bobcat-sdk utilities performing codesize efficient math on Arbitrum Stylus. |
| homepage | https://bobcat.so |
| repository | https://github.com/stylus-developers-guild/bobcat-sdk |
| max_upload_size | |
| id | 1880122 |
| size | 83,557 |
At arbos-forge release 5e956b7586b924778ff3b6117afb9153d47a18ce (1.4.4):
| Name | Gas cost |
|---|---|
| Ruint | 8673 |
| Muldiv Uniswap | 12674 |
| Widening then truncating | 587751 |
Anecdotally, the order of costs for the various muldiv functions look like this, when we used it in the 9lives repo for our DPPM code:
| Name | Codesize cost |
|---|---|
| Widening then truncating | Cheap |
| Muldiv Uniswap | Moderate |
| Ruint | Expensive |
So, you should make a decision based on the context of what you're working on when your
main focus is codesize, since there's undoubtably some reuse of code here. Do some
experimentation yourself. Ruint works with 64 bit words, then branches to pick different
algorithms. 9lives uses muldiv for fee taking operations, with numbers of either 1e6,
1000, and 1e12. You need to enable ruint with ruint-enabled. It might be more
appropriate to use ruint if you're already using U256 from alloy, given the amount of code
reuse presumably.