A simple lib that accurately does math for larger and smaller numbers, with decimals or without, negative or positive, and never reaches infinity.
Key Changes:
// use Int.Round(), Ceil(), Prob(), Floor() instead of built in BYOND functions.
var/Int/money = new(0)
money += 0.8
// money: 0.8
money += "0.7"
// money: 1.5
var/Int/rounded = result.Round()
// rounded: 2
var/Int/floored = result.Floor()
// floored: 1
// money: 1.5
money >= 0
// Result: 1
money -= "3"
// money: -1.5
money >= 0
// Result: 0
ID:2962204
![]() Jan 28, 10:00 pm
|
|