MCPcopy
hub / github.com/sql-js/sql.js / _floorFunc

Function _floorFunc

js/sql-debug.js:7349–7386  ·  view source on GitHub ↗
($0,$1,$2)

Source from the content-addressed store, hash-verified

7347 }
7348}
7349function _floorFunc($0,$1,$2) {
7350 $0 = $0|0;
7351 $1 = $1|0;
7352 $2 = $2|0;
7353 var $10 = 0.0, $11 = 0.0, $12 = 0, $13 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0, $8 = 0, $9 = 0, label = 0, sp = 0;
7354 sp = STACKTOP;
7355 $3 = ($1|0)==(1);
7356 if (!($3)) {
7357 ___assert_fail((16149|0),(16157|0),645,(16825|0));
7358 // unreachable;
7359 }
7360 $4 = HEAP32[$2>>2]|0;
7361 $5 = (_sqlite3_value_type($4)|0);
7362 switch ($5|0) {
7363 case 1: {
7364 $6 = HEAP32[$2>>2]|0;
7365 $7 = (_sqlite3_value_int64($6)|0);
7366 $8 = tempRet0;
7367 _sqlite3_result_int64($0,$7,$8);
7368 return;
7369 break;
7370 }
7371 case 5: {
7372 _sqlite3_result_null($0);
7373 return;
7374 break;
7375 }
7376 default: {
7377 $9 = HEAP32[$2>>2]|0;
7378 $10 = (+_sqlite3_value_double($9));
7379 $11 = (+Math_floor((+$10)));
7380 $12 = (~~$11)>>>0;
7381 $13 = +Math_abs($11) >= 1.0 ? $11 > 0.0 ? (~~+Math_min(+Math_floor($11 / 4294967296.0), 4294967295.0)) >>> 0 : ~~+Math_ceil(($11 - +(~~$11 >>> 0)) / 4294967296.0) >>> 0 : 0;
7382 _sqlite3_result_int64($0,$12,$13);
7383 return;
7384 }
7385 }
7386}
7387function _piFunc($0,$1,$2) {
7388 $0 = $0|0;
7389 $1 = $1|0;

Callers

nothing calls this directly

Calls 6

_sqlite3_value_typeFunction · 0.85
_sqlite3_value_int64Function · 0.85
_sqlite3_result_int64Function · 0.85
_sqlite3_result_nullFunction · 0.85
_sqlite3_value_doubleFunction · 0.85
___assert_failFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…