mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
Attempt to fix the SQLite core so that no floating point operations are used
anywhere if SQLITE_OMIT_FLOATING_POINT is defined at compile-time. This is useful to people who use SQLite on embedded processors that lack floating point support. (CVS 2749) FossilOrigin-Name: a0bdb584680ce6400d9e8c57db9d91197cc7b776
This commit is contained in:
@@ -14,7 +14,7 @@
|
||||
** This file contains functions for allocating memory, comparing
|
||||
** strings, and stuff like that.
|
||||
**
|
||||
** $Id: util.c,v 1.146 2005/09/17 18:34:11 drh Exp $
|
||||
** $Id: util.c,v 1.147 2005/10/13 02:09:50 drh Exp $
|
||||
*/
|
||||
#include "sqliteInt.h"
|
||||
#include <stdarg.h>
|
||||
@@ -606,6 +606,7 @@ int sqlite3IsNumber(const char *z, int *realnum, u8 enc){
|
||||
** for SQL. So this routine always uses "." regardless of locale.
|
||||
*/
|
||||
int sqlite3AtoF(const char *z, double *pResult){
|
||||
#ifndef SQLITE_OMIT_FLOATING_POINT
|
||||
int sign = 1;
|
||||
const char *zBegin = z;
|
||||
LONGDOUBLE_TYPE v1 = 0.0;
|
||||
@@ -656,6 +657,9 @@ int sqlite3AtoF(const char *z, double *pResult){
|
||||
}
|
||||
*pResult = sign<0 ? -v1 : v1;
|
||||
return z - zBegin;
|
||||
#else
|
||||
return sqlite3atoi64(z, pResult);
|
||||
#endif /* SQLITE_OMIT_FLOATING_POINT */
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user