Unity's Math System is

Something is wrong here.

I’ve tried so many different equations, it’s just broken.

Equation and results are as follows

  • 1/1 = 1
  • 2/2 = 1;
  • 1/2 = 0;
  • 10/56 = 0;
  • 10/50 = 0;
  • 10/10 = 1;
  • 1/100 = 0;
  • 2/100 = 0;
  • 100/100 = 1;

Somebody, explain what the flying fishing-rod is going on here, because I can’t do ANY MATHMATICAL CALCULATIONS like this

Welcome to integer division, where remainders are ignored. This may not be intuitive, but it’s actually a well-documented and important feature of many programming languages.

If you haven’t read up on the differences between int and float types, now is a good time.

1/2 is appropriately 0 – you gave two ints, so you’re getting an int back.

If you want fractional remainders, convert your operands to floats:

int x = 1/2;       //0
float y = 1.0/2.0; //0.5

int a = 1;
int b = 2;
float c = (1f*a)/(1f*b); //0.5