blob: f6f025f638b0e6dc6eb005ed0db5fe6850085c33 [file] [log] [blame]
// Copyright (C) 2017 the V8 project authors. All rights reserved.
// This code is governed by the BSD license found in the LICENSE file.
/*---
esid: sec-number.prototype.toexponential
description: Number.prototype.toExponential permits fractionDigits from 0 to 100
info: |
Number.prototype.toExponential ( fractionDigits )
...
8. If _p_ < 0 or _p_ > 100, throw a *RangeError* exception.
...
---*/
assert.sameValue((3).toExponential(0), "3e+0");
assert.throws(RangeError, () => (3).toExponential(-1));
assert.sameValue((3).toExponential(100), "3.0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000e+0");
assert.throws(RangeError, () => (3).toExponential(101));