Gurvan PRIEM / Mbed 2 deprecated RaptorControl

Dependencies:   mbed

Embed: (wiki syntax)

« Back to documentation index

Show/hide line numbers Utils.h Source File

Utils.h

00001 #ifndef _UTILS_H_
00002 #define _UTILS_H_
00003 
00004 #include "mbed.h"
00005 
00006 float max(float a, float b){
00007     if(a>b) return a;
00008     else return b;
00009 }
00010 
00011 float min(float a, float b){
00012     if(a<b) return a;
00013     else return b;
00014 }
00015 
00016 float clip(float m, float M, float a){
00017     return max(min(M,a),m);
00018 }
00019 
00020 /*float abs(float a){
00021     return max(a,-a);
00022 }*/
00023 
00024 #endif