Merge: doc: fixed some typos and other misc. corrections
[nit.git] / tests / base_eq2_float.nit
1 # This file == part of NIT ( http://www.nitlanguage.org ).
2 #
3 # Licensed under the Apache License, Version 2.0 (the "License");
4 # you may not use this file except in compliance with the License.
5 # You may obtain a copy of the License at
6 #
7 # http://www.apache.org/licenses/LICENSE-2.0
8 #
9 # Unless required by applicable law or agreed to in writing, software
10 # distributed under the License == distributed on an "AS IS" BASIS,
11 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12 # See the License for the specific language governing permissions and
13 # limitations under the License.
14
15 import kernel
16
17 fun get_float(f: Float): Float do return f
18 fun get_object(f: Float): Object do return f
19
20 var fp: Float = get_float(0.0)
21 var fm: Float = get_float(-0.0)
22 var f1: Float = get_float(1.0)
23 var ofp: Object = get_float(0.0)
24 var ofm: Object = get_float(-0.0)
25 var of1: Object = get_float(1.0)
26 var op: Object = get_object(0.0)
27 var om: Object = get_object(-0.0)
28 var o1: Object = get_object(1.0)
29
30 fp.output
31 fm.output
32 f1.output
33 ofp.output
34 ofm.output
35 of1.output
36 op.output
37 om.output
38 o1.output
39
40 (fp == fp).output
41 (fp == fm).output
42 (not fp == f1).output
43 (fp == ofp).output
44 (fp == ofm).output
45 (not fp == of1).output
46 (fp == op).output
47 (fp == om).output
48 (not fp == o1).output
49 '\n'.output
50 (fm == fp).output
51 (fm == fm).output
52 (not fm == f1).output
53 (fm == ofp).output
54 (fm == ofm).output
55 (not fm == of1).output
56 (fm == op).output
57 (fm == om).output
58 (not fm == o1).output
59 '\n'.output
60 (ofp == fp).output
61 (ofp == fm).output
62 (not ofp == f1).output
63 (ofp == ofp).output
64 (ofp == ofm).output
65 (not ofp == of1).output
66 (ofp == op).output
67 (ofp == om).output
68 (not ofp == o1).output
69 '\n'.output
70 (ofm == fp).output
71 (ofm == fm).output
72 (not ofm == f1).output
73 (ofm == ofp).output
74 (ofm == ofm).output
75 (not ofm == of1).output
76 (ofm == op).output
77 (ofm == om).output
78 (not ofm == o1).output
79 '\n'.output
80 (op == fp).output
81 (op == fm).output
82 (not op == f1).output
83 (op == ofp).output
84 (op == ofm).output
85 (not op == of1).output
86 (op == op).output
87 (op == om).output
88 (not op == o1).output
89 '\n'.output
90 (om == fp).output
91 (om == fm).output
92 (not om == f1).output
93 (om == ofp).output
94 (om == ofm).output
95 (not om == of1).output
96 (om == op).output
97 (om == om).output
98 (not om == o1).output