ECE 2036 Project

Dependencies:   mbed wave_player 4DGL-uLCD-SE

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers <title>math_extra.h Source File</title>

math_extra.h

00001 #pragma once
00002 
00003 // True if lower < x < upper
00004 int in_range(int x, int lower, int upper);
00005 
00006 // Clamps the value of x to the range [-limit, limit]
00007 float clamp(float x, float limit);
00008 
00009 // Returns the sign of x (-1, 0, or 1).
00010 int sgn(float x);
00011 
00012 // Returns either -1.0 or 1.0, randomly
00013 float coin_flip();