Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
無限大について全力で考えてみる
void CheckOverFlow(){
// 最大値を超えた時の動作を確認
float overMax = float.MaxValue + 1.0f;
Debug.Log("overMax : " + overMax);
float overMax31 = float.MaxValue + 1.0e+31f;
Debug.Log("overMax31 : " + overMax31);
float overMax32 = float.MaxValue + 1.0e+32f;
Debug.Log("overMax32 : " + overMax32);
float overMax33 = float.MaxValue + 1.0e+33f;
Debug.Log("overMax33 : " + overMax33);
// 最小値を下回った時の動作を確認
float underMin = float.MinValue - 1.0f;
Debug.Log("underMin : " + underMin);
float underMin31 = float.MinValue - 1.0e+31f;
Debug.Log("underMin31 : " + underMin31);
float underMin32 = float.MinValue - 1.0e+32f;
Debug.Log("underMin32 : " + underMin32);
float underMin33 = float.MinValue - 1.0e+33f;
Debug.Log("underMin33 : " + underMin33);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.