Here's the script reference document for Mathf.FloorToInt As you can see, it should round -0.5 down to -1. For some reason it seems to return it as 0 when used with my calculations.
I have two versions of the same functions that work in a very similar way but give different outputs. My code will only ever submit integers between 3 and 18 to these functions.
This version acts as if it were using Mathf.CielToInt (returns 0 in a case of statRoll = 9):
public int getBonus(int statRoll)
{
int result = Mathf.FloorToInt((statRoll - 10) / 2);
return result;
}
This is the version that works (returns -1 in a case of statRoll = 9):
public int getBonus(int statRoll)
{
float initial = statRoll - 10;
float divided = initial / 2;
int result = Mathf.FloorToInt(divided);
return result;
}