未验证 提交 20413f81 编写于 作者: E Earle F. Philhower, III 提交者: GitHub

Update toolchain to support std::remainder (#7849)

Update newlib to enable the __ieee754_remainder(f) calls required by
std::remainder and others.

Add device test for std::remainder variants.

Fixes #7845
上级 39d14530
#include <BSTest.h>
#include <cmath>
BS_ENV_DECLARE();
......@@ -30,6 +31,13 @@ TEST_CASE("#612 fmod and sqrt work", "[newlib]")
CHECK(fabs(fmod(-10, -3) - (-1.0)) < 1e-5);
}
TEST_CASE("#7845 std::remainder works", "[newlib]")
{
CHECK(fabs(std::remainder((double)10.123456, (double)5.0) - (double)0.123456) < 1e-5);
CHECK(fabs(std::remainder((float)15.123456, (float)5.0) - (float)0.123456) < 1e-5);
}
void loop()
{
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册