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.
Math/Math.h@0:01829868570e, 2015-01-03 (annotated)
- Committer:
- taylorza
- Date:
- Sat Jan 03 18:48:11 2015 +0000
- Revision:
- 0:01829868570e
First version with fixed point math
Who changed what in which revision?
| User | Revision | Line number | New contents of line |
|---|---|---|---|
| taylorza | 0:01829868570e | 1 | #include "Fix16.h" |
| taylorza | 0:01829868570e | 2 | #include "Vector3d.h" |
| taylorza | 0:01829868570e | 3 | |
| taylorza | 0:01829868570e | 4 | #ifndef __MATH_H__ |
| taylorza | 0:01829868570e | 5 | #define __MATH_H__ |
| taylorza | 0:01829868570e | 6 | |
| taylorza | 0:01829868570e | 7 | template <typename T> int sgn(T val) |
| taylorza | 0:01829868570e | 8 | { |
| taylorza | 0:01829868570e | 9 | return (T(0) < val) - (val < T(0)); |
| taylorza | 0:01829868570e | 10 | } |
| taylorza | 0:01829868570e | 11 | |
| taylorza | 0:01829868570e | 12 | #endif //__MATH_H__ |