Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // inputs: stat b, stat n
- // b^n = x
- // output: stat x
- // if b^n exeeds 2^63-1 or -2^63 x will overflow with no detection
- if (stat n >= 32) {
- stat b4 = %stat.player/b%
- stat b4 *= %stat.player/b4%
- stat b4 *= %stat.player/b4%
- stat b16 = %stat.player/b4%
- stat b16 *= %stat.player/b16%
- stat b16 *= %stat.player/b16%
- stat x = %stat.player/b16%
- stat x *= %stat.player/b16%
- stat nTemp = %stat.player/n%
- stat nTemp += 88
- } else {
- stat x = 1
- stat b4 = %stat.player/b%
- stat b4 *= %stat.player/b4%
- stat b4 *= %stat.player/b4%
- stat b16 = %stat.player/b4%
- stat b16 *= %stat.player/b16%
- stat b16 *= %stat.player/b16%
- stat nTemp = %stat.player/n%
- stat nTemp += 120
- }
- if (stat nTemp >= 136) {
- stat b -= 1
- stat b4 -= 1
- stat x *= %stat.player/b16%
- stat nTemp -= 16
- stat conditional = %stat.player/nTemp%
- stat conditional /= 128
- stat conditional *= 8
- stat nTemp -= %stat.player/conditional%
- stat conditional /= 8
- stat conditional *= %stat.player/b4%
- } else {
- stat b -= 1
- stat b4 -= 1
- stat conditional = %stat.player/nTemp%
- stat conditional /= 128
- stat conditional *= 8
- stat nTemp -= %stat.player/conditional%
- stat conditional /= 8
- stat conditional *= %stat.player/b4%
- }
- if (stat nTemp >= 124) {
- stat conditional += 1
- stat x *= %stat.player/conditional%
- stat x *= %stat.player/conditional%
- stat b4 += 1
- stat x *= %stat.player/b4%
- stat nTemp -= 62
- stat conditional = %stat.player/nTemp%
- stat conditional /= 64
- stat nTemp -= %stat.player/conditional%
- stat nTemp -= %stat.player/conditional%
- } else {
- stat conditional += 1
- stat x *= %stat.player/conditional%
- stat x *= %stat.player/conditional%
- stat nTemp -= 58
- stat conditional = %stat.player/nTemp%
- stat conditional /= 64
- stat nTemp -= %stat.player/conditional%
- stat nTemp -= %stat.player/conditional%
- }
- if (stat nTemp >= 63) {
- stat conditional *= %stat.player/b%
- stat conditional += 1
- stat x *= %stat.player/conditional%
- stat x *= %stat.player/conditional%
- stat b += 1
- stat x *= %stat.player/b%
- stat nTemp = 0
- stat b4 = 0
- stat b16 = 0
- stat conditional = 0
- } else {
- stat conditional *= %stat.player/b%
- stat conditional += 1
- stat x *= %stat.player/conditional%
- stat x *= %stat.player/conditional%
- stat nTemp = 0
- stat b += 1
- stat b4 = 0
- stat b16 = 0
- stat conditional = 0
- }
Advertisement
Add Comment
Please, Sign In to add comment