Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Dependents: rosserial_mbed_hello_world_publisher_melodic Motortest Nucleo_vr_servo_project NucleoFM ... more
Revision 1:da82487f547e, committed 2019-11-08
- Comitter:
- Gary Servin
- Date:
- Fri Nov 08 14:55:04 2019 -0300
- Parent:
- 0:04ac6be8229a
- Commit message:
- Add missing round() method
Changed in this revision
ros/duration.h | Show annotated file Show diff for this revision Revisions of this file |
ros/time.h | Show annotated file Show diff for this revision Revisions of this file |
--- a/ros/duration.h Fri Nov 08 14:38:09 2019 -0300 +++ b/ros/duration.h Fri Nov 08 14:55:04 2019 -0300 @@ -54,6 +54,10 @@ normalizeSecNSecSigned(sec, nsec); } + double round(double number) + { + return number < 0.0 ? ceil(number - 0.5): floor(number + 0.5); + }; double toSec() const { return (double)sec + 1e-9 * (double)nsec;
--- a/ros/time.h Fri Nov 08 14:38:09 2019 -0300 +++ b/ros/time.h Fri Nov 08 14:55:04 2019 -0300 @@ -54,6 +54,10 @@ normalizeSecNSec(sec, nsec); } + double round(double number) + { + return number < 0.0 ? ceil(number - 0.5): floor(number + 0.5); + }; double toSec() const { return (double)sec + 1e-9 * (double)nsec;