mirror of
https://github.com/servalproject/serval-dna.git
synced 2025-03-15 00:36:36 +00:00
Merge c536f939e969335ce01ee894e5acf48b495f8fa8 into 029adc177f7d86572bd34495003ae529ec67c41c
This commit is contained in:
commit
92f708c8cd
@ -103610,10 +103610,10 @@ static void roundFunc(sqlite3_context *context, int argc, sqlite3_value **argv){
|
||||
** handle the rounding directly,
|
||||
** otherwise use printf.
|
||||
*/
|
||||
if( n==0 && r>=0 && r<LARGEST_INT64-1 ){
|
||||
r = (double)((sqlite_int64)(r+0.5));
|
||||
}else if( n==0 && r<0 && (-r)<LARGEST_INT64-1 ){
|
||||
r = -(double)((sqlite_int64)((-r)+0.5));
|
||||
if( r<-4503599627370496.0 || r>+4503599627370496.0 ){
|
||||
/* The value has no fractional part so there is nothing to round */
|
||||
}else if( n==0 ){
|
||||
r = (double)((sqlite_int64)(r+(r<0?-0.5:+0.5)));
|
||||
}else{
|
||||
zBuf = sqlite3_mprintf("%.*f",n,r);
|
||||
if( zBuf==0 ){
|
||||
|
Loading…
x
Reference in New Issue
Block a user