| Blockland Forums > Modification Help |
| Anyone have experience with Ipquarx's BLMathLib? |
| (1/2) > >> |
| Crook:
Does this library work? https://github.com/Ipdude/BLMathLib If it does, can someone explain to me how to use some of the basic math operations? I can't get f_add(%num1, %num2) to return anything useful. Echoing it's result just gives me a global variable name, and that variable always contains 0. |
| PhantOS:
f_add doesn't return anything, its a mutator. after calling it you have to actually get the result yourself. i dont know how it works but it should be something like $n[number,index] i think? the parameters for f_add are supposedly array pointers |
| Ipquarx:
Here's the basics on how to use it. First, you have to create a reference to a number. use --- Code: ---%reference = f_makenum("hexadecimal_here"); --- End code --- to create a reference to a number. The hexadecimal will be put into the number, so if you do --- Code: ---%reference = f_makenum("1234"); --- End code --- it'll give you a reference to a number that contains the decimal value 4660. Then, to add two numbers, send the f_add, f_sub, etc functions two number references (they have to be different!) --- Code: ---f_add(%ref1, %ref2); --- End code --- (notice i'm not using the return value) will add the values %ref1 and %ref2 refer to, and place the result in %ref1. |
| jes00:
Seems like a long and complicated way to do something simple. |
| Gumba Jonny:
What advantages does this system provide? Right off the bat it looks like it can keep a history of every number that you use in a sequence of operations, at the downside of some added tedium. |
| Navigation |
| Message Index |
| Next page |