math.bmx 1.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. Strict
  2. Rem
  3. bbdoc: Math/Math
  4. End Rem
  5. Module BRL.Math
  6. ModuleInfo "Version: 1.05"
  7. ModuleInfo "Author: Mark Sibly"
  8. ModuleInfo "License: zlib/libpng"
  9. ModuleInfo "Copyright: Blitz Research Ltd"
  10. ModuleInfo "Modserver: BRL"
  11. ModuleInfo "History: 1.05 Release"
  12. ModuleInfo "History: Added IsNan and IsInf"
  13. Import "math.c"
  14. Extern
  15. Rem
  16. bbdoc: Check if a value is NAN
  17. returns: True if @x is 'not a number' (eg: Sqr(-1))
  18. End Rem
  19. Function IsNan( x:Double )="bbIsNan"
  20. Rem
  21. bbdoc: Check if a value is infinite (eg: 1.0/0.0)
  22. returns: True if @x is infinite
  23. End Rem
  24. Function IsInf( x:Double )="bbIsInf"
  25. Rem
  26. bbdoc: Square root of @x
  27. End Rem
  28. Function Sqr:Double( x:Double )="bbSqr"
  29. Rem
  30. bbdoc: Sine of @x degrees
  31. End Rem
  32. Function Sin:Double( x:Double )="bbSin"
  33. Rem
  34. bbdoc: Cosine of @x degrees
  35. End Rem
  36. Function Cos:Double( x:Double )="bbCos"
  37. Rem
  38. bbdoc: Tangent of @x degrees
  39. End Rem
  40. Function Tan:Double( x:Double )="bbTan"
  41. Rem
  42. bbdoc: Inverse Sine of @x
  43. End Rem
  44. Function ASin:Double( x:Double )="bbASin"
  45. Rem
  46. bbdoc: Inverse Cosine of @x
  47. End Rem
  48. Function ACos:Double( x:Double )="bbACos"
  49. Rem
  50. bbdoc: Inverse Tangent of @x
  51. End Rem
  52. Function ATan:Double( x:Double )="bbATan"
  53. Rem
  54. bbdoc: Inverse Tangent of two variables @x , @y
  55. End Rem
  56. Function ATan2:Double( y:Double,x:Double )="bbATan2"
  57. Rem
  58. bbdoc: Hyperbolic sine of @x
  59. End Rem
  60. Function Sinh:Double( x:Double )="bbSinh"
  61. Rem
  62. bbdoc: Hyperbolic cosine of @x
  63. End Rem
  64. Function Cosh:Double( x:Double )="bbCosh"
  65. Rem
  66. bbdoc: Hyperbolic tangent of @x
  67. End Rem
  68. Function Tanh:Double( x:Double )="bbTanh"
  69. Rem
  70. bbdoc: Exponential function
  71. end rem
  72. Function Exp:Double( x:Double )="bbExp"
  73. Rem
  74. bbdoc: Natural logarithm
  75. End Rem
  76. Function Log:Double( x:Double )="bbLog"
  77. Rem
  78. bbdoc: Base 10 logarithm
  79. End Rem
  80. Function Log10:Double( x:Double )="bbLog10"
  81. Rem
  82. bbdoc: Smallest integral value not less than @x
  83. End Rem
  84. Function Ceil:Double( x:Double )="bbCeil"
  85. Rem
  86. bbdoc: Largest integral value not greater than @x
  87. End Rem
  88. Function Floor:Double( x:Double )="bbFloor"
  89. End Extern