Advertisement
tabnation

math intro 1

Dec 22nd, 2021
80
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.98 KB | None
  1. ;General Math
  2. ;ABS
  3. 1::
  4. ;Value := Abs(Number)
  5. MsgBox, % Abs(-1.2) ; Returns 1.2
  6. return
  7.  
  8. ;Ceil
  9. 2::
  10. ;Value := Ceil(Number)
  11. MsgBox, % Ceil(1.2) ; Returns 2
  12. MsgBox, % Ceil(-1.2) ; Returns -1
  13. return
  14.  
  15. ;Floor
  16. 3::
  17. ;Value := Floor(Number)
  18. MsgBox, % Floor(1.2) ; Returns 1
  19. MsgBox, % Floor(-1.2) ; Returns -2
  20. return
  21.  
  22. ;Exp
  23. 4::
  24. ;Value := Exp(N)
  25. MsgBox, % Exp(1.2) ; Returns 3.320117
  26. return
  27.  
  28. ;log
  29. 5::
  30. ;Value := Log(Number)
  31. MsgBox, % Log(1.2) ; Returns 0.079181
  32. return
  33.  
  34. ;Max
  35. 6::
  36. ;Value := Max(Number1 , Number2, ...)
  37. MsgBox, % Max(2.11, -2, 0) ; Returns 2.11
  38. return
  39.  
  40. ;min
  41. 7::
  42. ;Value := Min(Number1 , Number2, ...)
  43. MsgBox, % Min(2.11, -2, 0) ; Returns -2
  44. return
  45.  
  46. ;MOD
  47. 8::
  48. ;Value := Mod(Dividend, Divisor)
  49. MsgBox, % Mod(7.5, 2) ; Returns 1.5 (2 x 3 + 1.5)
  50. return
  51.  
  52. ;ROUND
  53. 9::
  54. ;Value := Round(Number , N)
  55. MsgBox, % Round(3.14) ; Returns 3
  56. MsgBox, % Round(3.14, 1) ; Returns 3.1
  57. return
  58.  
  59. ;SQRT
  60. 0::
  61. ;Value := Sqrt(Number)
  62. MsgBox, % Sqrt(16) ; Returns 4
  63. return
Advertisement
RAW Paste Data Copied
Advertisement