Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Add device test for std::remainder variants
  • Loading branch information
earlephilhower committed Jan 29, 2021
commit 75e64d53fc466f8d881af517795cfed787e017d0
8 changes: 8 additions & 0 deletions tests/device/test_sw_newlib/test_sw_newlib.ino
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
#include <BSTest.h>
#include <cmath>
BS_ENV_DECLARE();


Expand Down Expand Up @@ -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()
{
}