Austin Schuh | c6423e6 | 2017-02-11 16:56:30 -0800 | [diff] [blame^] | 1 | #include "frc971/zeroing/wrap.h" |
2 | |||||
3 | #include <cmath> | ||||
4 | |||||
5 | namespace frc971 { | ||||
6 | namespace zeroing { | ||||
7 | |||||
8 | double Wrap(double nearest, double value, double period) { | ||||
9 | return ::std::remainder(value - nearest, period) + nearest; | ||||
10 | } | ||||
11 | |||||
12 | } // namespace zeroing | ||||
13 | } // namespace frc971 |