| 1 |
// Copyright (C) 2016 The V8 Project authors. All rights reserved. |
| 2 |
// This code is governed by the BSD license found in the LICENSE file. |
| 3 |
|
| 4 |
/*--- |
| 5 |
es6id: 20.2.2.11 |
| 6 |
esid: sec-math.clz32 |
| 7 |
description: > |
| 8 |
Return 32 if x is NaN |
| 9 |
info: | |
| 10 |
Math.clz32 ( x ) |
| 11 |
|
| 12 |
1. Let n be ToUint32(x). |
| 13 |
2. Let p be the number of leading zero bits in the 32-bit binary representation of n. |
| 14 |
3. Return p. |
| 15 |
|
| 16 |
7.1.6 ToUint32 ( argument ) |
| 17 |
|
| 18 |
[...] |
| 19 |
2. If number is NaN, +0, -0, +∞, or -∞, return +0. |
| 20 |
[...] |
| 21 |
---*/ |
| 22 |
|
| 23 |
assert.sameValue(Math.clz32(NaN), 32); |