mirror of
https://github.com/sqlite/sqlite.git
synced 2025-10-21 11:13:54 +03:00
Provide -DHAVE_LOG2=0 and -DHAVE_LOG10=0 compile-time options for use on systems
that lack the log2() and log10() standard math library routines, to cause SQLite to substitute its own alternatives. FossilOrigin-Name: 7ee22f95e7a7d8650f961f20e304e56c7813e624f05655d7392ca9347748270f
This commit is contained in:
12
src/func.c
12
src/func.c
@@ -2161,6 +2161,18 @@ static void ceilingFunc(
|
||||
static double xCeil(double x){ return ceil(x); }
|
||||
static double xFloor(double x){ return floor(x); }
|
||||
|
||||
/*
|
||||
** Some systems do not have log2() and log10() in their standard math
|
||||
** libraries.
|
||||
*/
|
||||
#if defined(HAVE_LOG10) && HAVE_LOG10==0
|
||||
# define log10(X) (0.4342944819032517867*log(X))
|
||||
#endif
|
||||
#if defined(HAVE_LOG2) && HAVE_LOG2==0
|
||||
# define log2(X) (1.442695040888963456*log(X))
|
||||
#endif
|
||||
|
||||
|
||||
/*
|
||||
** Implementation of SQL functions:
|
||||
**
|
||||
|
Reference in New Issue
Block a user