1/*
2 * Copyright (c) 2022 Huawei Device Co., Ltd.
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 is 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
16//declare function print(str:string):string;
17declare function print(str:any):number;
18
19var num1:number = 99
20var num2:number = 2
21var res:number = num1 % num2
22print(res)
23var num3: number = 50
24var num4: number = 45.5
25print(num3 % num4)
26var num5:number = Number.NaN;
27var num6:number = Number.NEGATIVE_INFINITY;
28var num7:number = Number.POSITIVE_INFINITY;
29var num8:number = 0.0;
30print(num8 % num4)
31print(num4 % num8)
32print(num4 % num5)
33print(num4 % num6)
34print(num4 % num7)
35print(num5 % num4)
36print(num6 % num4)
37print(num7 % num4)
38print(num5 % num5)
39print(num5 % num6)
40print(num5 % num7)
41print(num5 % num8)
42print(num6 % num5)
43print(num6 % num6)
44print(num6 % num7)
45print(num6 % num8)
46print(num7 % num5)
47print(num7 % num6)
48print(num7 % num7)
49print(num7 % num8)
50print(num8 % num5)
51print(num8 % num6)
52print(num8 % num7)
53print(num8 % num8)
54