I've been playing with the notion of making my own game engine and these are some starter functions I wrote for in game stats.

percentage

ratio

percentage

Code: C++

double percent(double n,double d)

{

return n / d * 100;

}

ratio

Code: C++

double ratio(double n,double d)

{

return n / d;

}