Search the Community
Showing results for tags 'maths'.
Found 1 result
OK, hopefully someone can help me here as whatever I do always results in a 0 (zero) output! I'm just trying to do a simple calculation to work out the percentage of memory. It really shouldn't be so difficult, should it?? I thought maybe there was limitation with how much maths could be done in one line, so I split the two calculations up and it still doesn't work as expected. The calculation should look something like: 34968 / 65536 * 100 which rounded up should be about 53%. I wasn't sure if you could use parenthesis in it or not, but it didn't work anyway (eg: (34968 / 65536) * 100) integer used_memory = llGetUsedMemory(); integer total_memory = llGetMemoryLimit(); float percentageMaths = used_memory / total_memory; float percentageMemory = percentageMaths * 100; llOwnerSay("Memory used as percentage: " + (string)llRound(percentageMemory)); //result as: "Memory used as percentage: 0" Any insights?