• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Asset - Scripts Big Numbers

zbox

Member
GMC Elder
Marketplace: https://marketplace.yoyogames.com/assets/4937/big-numbers
Category: Scripts
Price: $1.99 FREE
Modules: All

Description:
A set of scripts that allows you to store huge non-negative (to be added) numbers accurately in any base (Cookie clicker style games for example). Gamemaker's inbuilt numbers will only extend to a certain amount, with this library you can infinitely add, subtract and multiply integers. You can use any base you like and supply your own alphabet (allows using hexadecimal numbers etc).

Useage: (much, much larger numbers can be used but smaller values are shown for simplicity)
Code:
add("100", -50, "300", "-20") //   returns "330"
mult("3148275", 245) //   returns "771327375"
bignumber_a_greaterthan_b("100", "1"); //  returns true

var a = add("10", "2"), b = mult("6", 2);
if (a == b)
    show_message("This message will show!");

math_set_alphabet("0123456789ABCDEF");
math_set_radix(16);
add("8AB", "B7F"); //   returns 142A
 
Last edited:

zbox

Member
GMC Elder
Free for a few days. Would rather people use this than it sit on one dollar and not get bought :)
 
Top