A more precise implementation of sqlite3RealToI64().
FossilOrigin-Name: 8813317cb52990d90bd48de163b6e35ddcad2b6f3187aa28b28e2e088b4489ce
This commit is contained in:
+2
-2
@@ -731,8 +731,8 @@ int sqlite3RealSameAsInt(double r1, sqlite3_int64 i){
|
||||
** from UBSAN.
|
||||
*/
|
||||
i64 sqlite3RealToI64(double r){
|
||||
if( r<=(double)SMALLEST_INT64 ) return SMALLEST_INT64;
|
||||
if( r>=(double)LARGEST_INT64) return LARGEST_INT64;
|
||||
if( r<-9223372036854774784.0 ) return SMALLEST_INT64;
|
||||
if( r>+9223372036854774784.0 ) return LARGEST_INT64;
|
||||
return (i64)r;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user