Skip to content

Commit dc182e1

Browse files
author
mars
committed
static inline function replaced
1 parent c2ee049 commit dc182e1

2 files changed

Lines changed: 12 additions & 10 deletions

File tree

LibSource/basicmaths.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,16 @@
11
#include "basicmaths.h"
22
#include <stdint.h>
33

4+
float arm_sqrtf(float in){
5+
float out;
6+
#ifdef ARM_CORTEX
7+
arm_sqrt_f32(in, &out);
8+
#else
9+
out=sqrtf(in);
10+
#endif
11+
return out;
12+
}
13+
414
float fastpowf(float a, float b){
515
/* Taken from
616
* http://martin.ankerl.com/2007/10/04/optimized-pow-approximation-for-java-and-c-c/

LibSource/basicmaths.h

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,6 @@
2525

2626
#ifdef __cplusplus
2727
#include <cmath>
28-
//#include <algorithm>
2928
#else
3029
#include <math.h>
3130
#endif
@@ -56,15 +55,8 @@
5655
#ifdef __cplusplus
5756
extern "C" {
5857
#endif
59-
inline float arm_sqrtf(float in){
60-
float out;
61-
#ifdef ARM_CORTEX
62-
arm_sqrt_f32(in, &out);
63-
#else
64-
out=sqrtf(in);
65-
#endif
66-
return out;
67-
}
58+
59+
float arm_sqrtf(float in);
6860

6961
// fast approximations
7062
float fastlog2f(float x);

0 commit comments

Comments
 (0)