mirror of
https://github.com/openmv/openmv.git
synced 2025-11-04 14:49:50 +08:00
Add ceil
This commit is contained in:
parent
2f5b82ec77
commit
06c8f77662
@ -31,6 +31,17 @@ int ALWAYS_INLINE fast_floorf(float x)
|
||||
return i;
|
||||
}
|
||||
|
||||
int ALWAYS_INLINE fast_ceilf(float x)
|
||||
{
|
||||
int i;
|
||||
x += 0.9999f;
|
||||
asm volatile (
|
||||
"vcvt.S32.f32 %[r], %[x]\n"
|
||||
: [r] "=t" (i)
|
||||
: [x] "t" (x));
|
||||
return i;
|
||||
}
|
||||
|
||||
int ALWAYS_INLINE fast_roundf(float x)
|
||||
{
|
||||
int i;
|
||||
|
||||
@ -2,7 +2,8 @@
|
||||
#define __FMATH_H__
|
||||
#include <stdint.h>
|
||||
float fast_sqrtf(float x);
|
||||
int fast_floor(float x);
|
||||
int fast_floorf(float x);
|
||||
int fast_ceilf(float x);
|
||||
int fast_roundf(float x);
|
||||
float fast_atanf(float x);
|
||||
float fast_atan2f(float x, float y);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user