Skip to content

Instantly share code, notes, and snippets.

@todorok1
Created June 15, 2018 08:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save todorok1/076da97e5c3fe62ee3171ee0d8098970 to your computer and use it in GitHub Desktop.
Save todorok1/076da97e5c3fe62ee3171ee0d8098970 to your computer and use it in GitHub Desktop.
無限大について全力で考えてみる
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