jswrap_math.h 881 B

12345678910111213141516171819202122232425262728
  1. /*
  2. * This file is part of Espruino, a JavaScript interpreter for Microcontrollers
  3. *
  4. * Copyright (C) 2013 Gordon Williams <gw@pur3.co.uk>
  5. *
  6. * This Source Code Form is subject to the terms of the Mozilla Public
  7. * License, v. 2.0. If a copy of the MPL was not distributed with this
  8. * file, You can obtain one at http://mozilla.org/MPL/2.0/.
  9. *
  10. * ----------------------------------------------------------------------------
  11. * Contains built-in functions for Maths
  12. * ----------------------------------------------------------------------------
  13. */
  14. #include "jsutils.h"
  15. #include "jsvar.h"
  16. #ifdef ARM
  17. #include "mconf.h"
  18. #include "protos.h"
  19. #else
  20. #include <math.h>
  21. #endif
  22. JsVarInt jswrap_integer_valueOf(JsVar *v);
  23. JsVarFloat jswrap_math_abs(JsVarFloat x);
  24. double jswrap_math_pow(double x, double y);
  25. JsVarFloat jswrap_math_clip(JsVarFloat x, JsVarFloat min, JsVarFloat max);