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.
Dependencies: 4DGL-uLCD-SE mbed wave_player
Fork of MazeRunner_Fall2017-shell by
Diff: math_extra.h
- Revision:
- 0:cf4396614a79
- Child:
- 1:2c6ae0fe9a2a
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/math_extra.h Fri Nov 03 18:48:48 2017 +0000 @@ -0,0 +1,13 @@ +#pragma once + +// True if lower < x < upper +int in_range(int x, int lower, int upper); + +// Clamps the value of x to the range [-limit, limit] +float clamp(float x, float limit); + +// Returns the sign of x (-1, 0, or 1). +int sgn(float x); + +// Returns either -1.0 or 1.0, randomly +float coin_flip(); \ No newline at end of file
