-
Notifications
You must be signed in to change notification settings - Fork 1.7k
/
Copy pathnan_branching_test.dart
43 lines (38 loc) · 1.29 KB
/
nan_branching_test.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
// for details. All rights reserved. Use of this source code is governed by a
// BSD-style license that can be found in the LICENSE file.
@pragma("vm:never-inline")
@pragma("dart2js:noInline")
double hiddenZero() => double.parse("0.0");
@pragma("vm:never-inline")
@pragma("dart2js:noInline")
double hiddenNaN() => double.parse("NaN");
void main() {
if (hiddenZero() == hiddenNaN()) throw "==";
if (hiddenZero() != hiddenNaN()) {
} else {
throw "!=";
}
if (hiddenZero() < hiddenNaN()) throw "<";
if (hiddenZero() <= hiddenNaN()) throw "<=";
if (hiddenZero() > hiddenNaN()) throw ">";
if (hiddenZero() >= hiddenNaN()) throw ">=";
if (hiddenNaN() == hiddenNaN()) throw "==";
if (hiddenNaN() != hiddenNaN()) {
} else {
throw "!=";
}
if (hiddenNaN() < hiddenNaN()) throw "<";
if (hiddenNaN() <= hiddenNaN()) throw "<=";
if (hiddenNaN() > hiddenNaN()) throw ">";
if (hiddenNaN() >= hiddenNaN()) throw ">=";
if (hiddenNaN() == hiddenZero()) throw "==";
if (hiddenNaN() != hiddenZero()) {
} else {
throw "!=";
}
if (hiddenNaN() < hiddenZero()) throw "<";
if (hiddenNaN() <= hiddenZero()) throw "<=";
if (hiddenNaN() > hiddenZero()) throw ">";
if (hiddenNaN() >= hiddenZero()) throw ">=";
}