using UnityEngine;
using System.Collections;
public class Math : MonoBehaviour {
int value = 10;
float ratio1 = 1.1f;
float ratio2 = 1.2f;
float ratio3 = 1.3f;
void Start () {
Debug.Log (value * ratio1);
Debug.Log (value * ratio2);
Debug.Log (value * ratio3);
Debug.Log ((int)(value * ratio1));
Debug.Log ((int)(value * ratio2));
Debug.Log ((int)(value * ratio3));
}
}
I expect the result will be:
11
12
13
11
12
13
However, the actual result is:
11
12
13
11
12
12
How can I fix the problem?