Angus Gratton 2f249edb8e Use std::abs for a float-compatible abs() function (#2738)
* Other Arduino cores uses a macro to redefine libc abs() to take any
  type, meaning abs(-3.3) == 3.3 not the normal libc result of 3.

* 1e4bf14a3 (#1783) replaced similar min, max macros with c++ stdlib. However
  this change includes <algorithm> after the line which defines the abs() macro.
  <algorithm> includes <cstdlib> which undefines abs() and re-defines it.

* This means abs() becomes the plain libc version again which only takes
  integers, so abs(-3.3) == 3. As reported here:
  https://github.com/espressif/esp-idf/issues/3405

This fix tries to keep in the spirit of #1783 by using libstdc++. The other
option would be to include <cstdlib> before defining the abs() macro, so it
doesn't get undef-ed again later on.
2019-05-11 11:18:39 +03:00
..
2016-10-06 07:09:44 -06:00
2016-10-06 07:09:44 -06:00
2018-06-27 09:01:06 +02:00
2018-12-28 19:14:15 +02:00
2017-01-09 18:05:30 +02:00
2016-10-06 07:09:44 -06:00
2016-10-06 07:09:44 -06:00
2019-05-01 20:10:41 +03:00
2016-12-09 17:47:30 +02:00
2016-12-12 01:32:55 +02:00
2016-12-12 01:32:55 +02:00
2017-01-06 00:54:50 +02:00
2017-01-06 00:54:50 +02:00
2016-10-06 07:09:44 -06:00
2016-10-06 07:09:44 -06:00
2016-10-06 07:09:44 -06:00
2018-06-27 09:01:06 +02:00
2016-10-06 07:09:44 -06:00
2019-05-11 11:16:05 +03:00
2016-10-06 07:09:44 -06:00
2016-10-06 07:09:45 -06:00
2017-01-20 21:49:17 +02:00
2019-02-18 12:18:49 +02:00