Guest User

Untitled

a guest
Jun 18th, 2018
63
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.56 KB | None | 0 0
  1. void FourArithmeticInfinity(){
  2. // 足し算
  3. // 無限大に数値を足す
  4. float additionToInf = Mathf.Infinity + 1.0e+38f;
  5. Debug.Log("additionToInf : " + additionToInf);
  6.  
  7. // 無限大に無限大を足す
  8. float additionInfToInf = Mathf.Infinity + Mathf.Infinity;
  9. Debug.Log("additionInfToInf : " + additionInfToInf);
  10.  
  11.  
  12. // 引き算
  13. // 無限大から数値を引く
  14. float subtractionFromInf = Mathf.Infinity - 1.0e+38f;
  15. Debug.Log("subtractionFromInf : " + subtractionFromInf);
  16.  
  17. // 無限大から無限大を引く
  18. float subtractionInfFromInf = Mathf.Infinity - Mathf.Infinity;
  19. Debug.Log("subtractionInfFromInf : " + subtractionInfFromInf);
  20.  
  21.  
  22. // 掛け算
  23. // 無限大に数値を掛ける
  24. float multiplicationInf = Mathf.Infinity * 1.0e+38f;
  25. Debug.Log("multiplicationInf : " + multiplicationInf);
  26.  
  27. // 無限大に無限大を掛ける
  28. float multiplicationInfByInf = Mathf.Infinity * Mathf.Infinity;
  29. Debug.Log("multiplicationInfByInf : " + multiplicationInfByInf);
  30.  
  31. // 無限大に0を掛ける
  32. float multiplicationInfByZero = Mathf.Infinity * 0f;
  33. Debug.Log("multiplicationInfByZero : " + multiplicationInfByZero);
  34.  
  35.  
  36. // 割り算
  37. // 無限大を数値で割る
  38. float divisionInf = Mathf.Infinity / 1.0e+38f;
  39. Debug.Log("divisionInf : " + divisionInf);
  40.  
  41. // 無限大を無限大で割る
  42. float divisionInfByInf = Mathf.Infinity / Mathf.Infinity;
  43. Debug.Log("divisionInfByInf : " + divisionInfByInf);
  44.  
  45. // 無限大を0で割る
  46. float divisionInfByZero = Mathf.Infinity / 0f;
  47. Debug.Log("divisionInfByZero : " + divisionInfByZero);
  48. }
Add Comment
Please, Sign In to add comment