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

Function _ceilFunc

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

Source from the content-addressed store, hash-verified

7309 }
7310}
7311function _ceilFunc($0,$1,$2) {
7312 $0 = $0|0;
7313 $1 = $1|0;
7314 $2 = $2|0;
7315 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;
7316 sp = STACKTOP;
7317 $3 = ($1|0)==(1);
7318 if (!($3)) {
7319 ___assert_fail((16149|0),(16157|0),620,(16816|0));
7320 // unreachable;
7321 }
7322 $4 = HEAP32[$2>>2]|0;
7323 $5 = (_sqlite3_value_type($4)|0);
7324 switch ($5|0) {
7325 case 1: {
7326 $6 = HEAP32[$2>>2]|0;
7327 $7 = (_sqlite3_value_int64($6)|0);
7328 $8 = tempRet0;
7329 _sqlite3_result_int64($0,$7,$8);
7330 return;
7331 break;
7332 }
7333 case 5: {
7334 _sqlite3_result_null($0);
7335 return;
7336 break;
7337 }
7338 default: {
7339 $9 = HEAP32[$2>>2]|0;
7340 $10 = (+_sqlite3_value_double($9));
7341 $11 = (+Math_ceil((+$10)));
7342 $12 = (~~$11)>>>0;
7343 $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;
7344 _sqlite3_result_int64($0,$12,$13);
7345 return;
7346 }
7347 }
7348}
7349function _floorFunc($0,$1,$2) {
7350 $0 = $0|0;
7351 $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…