PageRenderTime 61ms CodeModel.GetById 35ms RepoModel.GetById 0ms app.codeStats 0ms

/trickmath.h

https://github.com/AlbertVeli/Carnival
C Header | 72 lines | 9 code | 10 blank | 53 comment | 0 complexity | 967004ff2b0b32157cf4f4d895de01d8 MD5 | raw file
  1. #ifndef __TRICKMATH_H
  2. #define __TRICKMATH_H
  3. /**
  4. * @file trickmath.h
  5. * @brief Tricky math include.
  6. */
  7. /************************************************************************
  8. * ___ _ _
  9. * B / __\__ _ _ __ _ __ (_)_ ____ _| |
  10. * O / / / _` | '__| '_ \| \ \ / / _` | |
  11. * O / /__| (_| | | | | | | |\ V / (_| | |
  12. * M \____/\__,_|_| |_| |_|_| \_/ \__,_|_|
  13. *
  14. * $Id: $
  15. *
  16. * Authors
  17. * - Albert Veli
  18. *
  19. * Copyright (C) 2007 Albert Veli
  20. *
  21. * ------------------------------
  22. *
  23. * This file is part of Carnival
  24. *
  25. * Carnival is free software; you can redistribute it and/or modify
  26. * it under the terms of the GNU General Public License as published by
  27. * the Free Software Foundation; either version 3 of the License, or
  28. * (at your option) any later version.
  29. *
  30. * Carnival is distributed in the hope that it will be useful,
  31. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  32. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  33. * GNU General Public License for more details.
  34. *
  35. * You should have received a copy of the GNU General Public License
  36. * along with this program; if not, write to the Free Software Foundation,
  37. * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
  38. *
  39. ************************************************************************/
  40. /* ----------------------------------------------
  41. * Macros
  42. * ----------------------------------------------
  43. */
  44. #define SQRTFAST(x) ((x) * Q_rsqrt(x))
  45. /* ----------------------------------------------
  46. * Exported functions from trickmath.c
  47. * ----------------------------------------------
  48. */
  49. float Q_rsqrt(float number);
  50. inline float u8sin(unsigned char v);
  51. inline float u8cos(unsigned char v);
  52. inline float u8sinf(float v);
  53. inline float u8cosf(float v);
  54. /**
  55. * GNU Emacs settings: K&R with 3 spaces indent.
  56. * Local Variables:
  57. * c-file-style: "k&r"
  58. * c-basic-offset: 3
  59. * indent-tabs-mode: nil
  60. * End:
  61. */
  62. #endif /* __TRICKMATH_H */