mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 07:18:39 +09:00
Issue #1240 - Part 5b - BigInt support for basic arithmetic operations. https://bugzilla.mozilla.org/show_bug.cgi?id=1471134 Parts 3-5.
This commit is contained in:
parent
25ee810247
commit
44b5d8dec3
8 changed files with 88 additions and 54 deletions
|
|
@ -684,28 +684,22 @@ js::ecmaPow(double x, double y)
|
|||
return pow(x, y);
|
||||
}
|
||||
|
||||
bool
|
||||
js::math_pow_handle(JSContext* cx, HandleValue base, HandleValue power, MutableHandleValue result)
|
||||
{
|
||||
double x;
|
||||
if (!ToNumber(cx, base, &x))
|
||||
return false;
|
||||
|
||||
double y;
|
||||
if (!ToNumber(cx, power, &y))
|
||||
return false;
|
||||
|
||||
double z = ecmaPow(x, y);
|
||||
result.setNumber(z);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool
|
||||
js::math_pow(JSContext* cx, unsigned argc, Value* vp)
|
||||
{
|
||||
CallArgs args = CallArgsFromVp(argc, vp);
|
||||
|
||||
return math_pow_handle(cx, args.get(0), args.get(1), args.rval());
|
||||
double x;
|
||||
if (!ToNumber(cx, args.get(0), &x))
|
||||
return false;
|
||||
|
||||
double y;
|
||||
if (!ToNumber(cx, args.get(1), &y))
|
||||
return false;
|
||||
|
||||
double z = ecmaPow(x, y);
|
||||
args.rval().setNumber(z);
|
||||
return true;
|
||||
}
|
||||
|
||||
uint64_t
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue