MCPcopy Create free account
hub / github.com/sql-js/sql.js / _sqrtFunc

Function _sqrtFunc

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

Source from the content-addressed store, hash-verified

7232 }
7233}
7234function _sqrtFunc($0,$1,$2) {
7235 $0 = $0|0;
7236 $1 = $1|0;
7237 $2 = $2|0;
7238 var $10 = 0, $11 = 0, $12 = 0.0, $13 = 0, $14 = 0, $15 = 0, $16 = 0, $17 = 0, $3 = 0, $4 = 0, $5 = 0, $6 = 0, $7 = 0.0, $8 = 0, $9 = 0, $cond = 0, label = 0, sp = 0;
7239 sp = STACKTOP;
7240 $3 = ($1|0)==(1);
7241 if (!($3)) {
7242 ___assert_fail((16149|0),(16157|0),375,(16796|0));
7243 // unreachable;
7244 }
7245 $4 = HEAP32[$2>>2]|0;
7246 $5 = (_sqlite3_value_type($4)|0);
7247 $cond = ($5|0)==(5);
7248 if ($cond) {
7249 _sqlite3_result_null($0);
7250 return;
7251 }
7252 $6 = HEAP32[$2>>2]|0;
7253 $7 = (+_sqlite3_value_double($6));
7254 $8 = (___errno_location()|0);
7255 HEAP32[$8>>2] = 0;
7256 $9 = (___errno_location()|0);
7257 $10 = HEAP32[$9>>2]|0;
7258 $11 = ($10|0)==(0);
7259 if ($11) {
7260 $12 = (+Math_sqrt((+$7)));
7261 _sqlite3_result_double($0,$12);
7262 return;
7263 } else {
7264 $13 = (___errno_location()|0);
7265 $14 = HEAP32[$13>>2]|0;
7266 $15 = (_strerror($14)|0);
7267 $16 = (___errno_location()|0);
7268 $17 = HEAP32[$16>>2]|0;
7269 _sqlite3_result_error($0,$15,$17);
7270 return;
7271 }
7272}
7273function _squareFunc($0,$1,$2) {
7274 $0 = $0|0;
7275 $1 = $1|0;

Callers

nothing calls this directly

Calls 8

_sqlite3_value_typeFunction · 0.85
_sqlite3_result_nullFunction · 0.85
_sqlite3_value_doubleFunction · 0.85
___errno_locationFunction · 0.85
_sqlite3_result_doubleFunction · 0.85
_strerrorFunction · 0.85
_sqlite3_result_errorFunction · 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…