I have to calculate some percentages but I have to avoid using floats in Rust.
i have this data structure
let data = Vec<Identity, u64>
from this i can sum all the u64's to get a total which we'll call the total maturity
let total_maturity = data.iter().map(|(,b)| b).sum()
so now i have the total maturity across all of them. it should be fairly trivial to get the percentage of maturity for each neuron but how i do i express this.
With floats it would be simple and the resulting vec of percentages associated with a neuron would be like [0.3, 0.4, 0.1 ....]
I've heard of using integer math but im not sure how it really works.