ECE 2036 Project

Dependencies:   mbed wave_player 4DGL-uLCD-SE

math_extra.h

Committer:
abraha2d
Date:
2019-11-21
Revision:
2:2042f29de6b7
Parent:
0:cf4396614a79

File content as of revision 2:2042f29de6b7:

#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();