1
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2
/* This Source Code Form is subject to the terms of the Mozilla Public
3
* License, v. 2.0. If a copy of the MPL was not distributed with this
4
* file, You can obtain one at http://mozilla.org/MPL/2.0/. */
8
File Name: 15.8.2.12.js
9
ECMA Section: 15.8.2.12 Math.min(x, y)
10
Description: return the smaller of the two arguments.
12
- if x is NaN or y is NaN return NaN
15
- if x is +0 and y is +0 return +0
16
- if x is +0 and y is -0 return -0
17
- if x is -0 and y is +0 return -0
18
- if x is -0 and y is -0 return -0
19
Author: christine@netscape.com
24
var SECTION = "15.8.2.12";
25
var VERSION = "ECMA_1";
26
var TITLE = "Math.min(x, y)";
27
var BUGNUMBER="76439";
31
writeHeaderToLog( SECTION + " "+ TITLE);
33
new TestCase( SECTION,
38
new TestCase( SECTION,
43
new TestCase( SECTION,
44
"Math.min(void 0, 1)",
46
Math.min( void 0, 1 ) );
48
new TestCase( SECTION,
49
"Math.min(void 0, void 0)",
51
Math.min( void 0, void 0 ) );
53
new TestCase( SECTION,
56
Math.min( null, 1 ) );
58
new TestCase( SECTION,
61
Math.min( -1, null ) );
63
new TestCase( SECTION,
64
"Math.min(true, false)",
66
Math.min(true,false) );
68
new TestCase( SECTION,
69
"Math.min('-99','99')",
71
Math.min( "-99","99") );
73
new TestCase( SECTION,
76
Math.min(Number.NaN,0) );
78
new TestCase( SECTION,
81
Math.min(Number.NaN,1) );
83
new TestCase( SECTION,
86
Math.min(Number.NaN,-1) );
88
new TestCase( SECTION,
91
Math.min(0,Number.NaN) );
93
new TestCase( SECTION,
96
Math.min(1,Number.NaN) );
98
new TestCase( SECTION,
101
Math.min(-1,Number.NaN) );
103
new TestCase( SECTION,
106
Math.min(Number.NaN,Number.NaN) );
108
new TestCase( SECTION,
109
"Math.min(1,1.0000000001)",
111
Math.min(1,1.0000000001) );
113
new TestCase( SECTION,
114
"Math.min(1.0000000001,1)",
116
Math.min(1.0000000001,1) );
118
new TestCase( SECTION,
123
new TestCase( SECTION,
128
new TestCase( SECTION,
133
new TestCase( SECTION,
134
"Infinity/Math.min(0,-0)",
136
Infinity/Math.min(0,-0) );
138
new TestCase( SECTION,
139
"Infinity/Math.min(-0,-0)",
141
Infinity/Math.min(-0,-0) );