math.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  1. /////////////////////////////////////////////////////////////////////////////
  2. // Name: math.h
  3. // Purpose: interface of global functions
  4. // Author: wxWidgets team
  5. // Licence: wxWindows licence
  6. /////////////////////////////////////////////////////////////////////////////
  7. /** @addtogroup group_funcmacro_math */
  8. //@{
  9. /**
  10. Returns a non-zero value if @a x is neither infinite nor NaN (not a
  11. number), returns 0 otherwise.
  12. @header{wx/math.h}
  13. */
  14. int wxFinite(double x);
  15. /**
  16. Returns a non-zero value if x is NaN (not a number), returns 0 otherwise.
  17. @header{wx/math.h}
  18. */
  19. bool wxIsNaN(double x);
  20. /**
  21. Converts the given array of 10 bytes (corresponding to 80 bits) to
  22. a float number according to the IEEE floating point standard format
  23. (aka IEEE standard 754).
  24. @see wxConvertToIeeeExtended() to perform the opposite operation
  25. */
  26. wxFloat64 wxConvertFromIeeeExtended(const wxInt8 *bytes);
  27. /**
  28. Converts the given floating number @a num in a sequence of 10 bytes
  29. which are stored in the given array @a bytes (which must be large enough)
  30. according to the IEEE floating point standard format
  31. (aka IEEE standard 754).
  32. @see wxConvertFromIeeeExtended() to perform the opposite operation
  33. */
  34. void wxConvertToIeeeExtended(wxFloat64 num, wxInt8 *bytes);
  35. /**
  36. Small wrapper around round().
  37. */
  38. int wxRound(double x);
  39. /**
  40. Returns true if both double values are identical. This is
  41. only reliable if both values have been assigned the same
  42. value.
  43. */
  44. bool wxIsSameDouble(double x, double y);
  45. /**
  46. Return true of @a x is exactly zero. This is only reliable
  47. if it has been assigned 0.
  48. */
  49. bool wxIsNullDouble(double x);
  50. //@}