Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
TASTE
uPython-mirror
Commits
56da07dc
Commit
56da07dc
authored
Aug 05, 2014
by
Damien George
Browse files
stmhal, math: Define _M_LN2 if not already defined.
Addresses issue #790.
parent
dd07023c
Changes
1
Hide whitespace changes
Inline
Side-by-side
stmhal/math.c
View file @
56da07dc
...
@@ -102,6 +102,10 @@ float copysignf(float x, float y) {
...
@@ -102,6 +102,10 @@ float copysignf(float x, float y) {
#ifdef log2f
#ifdef log2f
#undef log2f
#undef log2f
#endif
#endif
// some compilers have _M_LN2 defined in math.h, some don't
#ifndef _M_LN2
#define _M_LN2 (0.69314718055994530942)
#endif
float
log2f
(
float
x
)
{
return
logf
(
x
)
/
(
float
)
_M_LN2
;
}
float
log2f
(
float
x
)
{
return
logf
(
x
)
/
(
float
)
_M_LN2
;
}
static
const
float
_M_LN10
=
2
.
30258509299404
;
// 0x40135d8e
static
const
float
_M_LN10
=
2
.
30258509299404
;
// 0x40135d8e
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment