mirror of
https://github.com/PX4/PX4-Autopilot.git
synced 2026-05-31 02:16:53 +08:00
mathlib expo template style
This commit is contained in:
@@ -42,13 +42,13 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <platforms/px4_defines.h>
|
#include <platforms/px4_defines.h>
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
namespace math
|
namespace math
|
||||||
{
|
{
|
||||||
|
|
||||||
// Type-safe signum function
|
// Type-safe signum function
|
||||||
template<typename T> int sign(T val)
|
template<typename T>
|
||||||
|
int sign(T val)
|
||||||
{
|
{
|
||||||
return (T(0) < val) - (val < T(0));
|
return (T(0) < val) - (val < T(0));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -40,7 +40,6 @@
|
|||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <platforms/px4_defines.h>
|
#include <platforms/px4_defines.h>
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
//this should be defined in stdint.h, but seems to be missing in the ARM toolchain (5.2.0)
|
//this should be defined in stdint.h, but seems to be missing in the ARM toolchain (5.2.0)
|
||||||
#ifndef UINT64_C
|
#ifndef UINT64_C
|
||||||
|
|||||||
Reference in New Issue
Block a user