1
0
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:
drh
2023-02-23 01:52:54 +00:00
parent af03eb3241
commit 3c2688d137
3 changed files with 19 additions and 7 deletions

View File

@@ -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:
**