1/* 2 * Copyright (c) 2022-2025 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 16let n1:number = 123; 17let n2:bigint = 456n; 18 19n1 <= n2 20n1 == n2 21n1 >= n2 22 23n1 != n2 24n1 !== n2 25n1 === n2 26n1 > n2 27n1 < n2 28 29n1 = n2 30n1 + n2 31n1 - n2 32n1 * n2 33n1 / n2 34n1 % n2 35 36function parFunPar(params: boolean) {} 37parFunPar(1n > 1.0); 38parFunPar(1n < 1.0); 39parFunPar(1n >= 1.0); 40parFunPar(1n <= 1.0); 41parFunPar(1n == 1.0); 42 43function parFunReturn() : boolean { 44 return 1n > 1.0; 45} 46function parFunReturn1() : boolean { 47 return 1n < 1.0; 48} 49function parFunReturn2() : boolean { 50 return 1n >= 1.0; 51} 52function parFunReturn3() : boolean { 53 return 1n <= 1.0; 54} 55function parFunReturn4() : boolean { 56 return 1n == 1.0; 57} 58 59if (1n > 1.0) { 60 console.log('1n > 1.0'); 61} 62if (1n < 1.0) { 63 console.log('1n < 1.0'); 64} 65if (1n >= 1.0) { 66 console.log('1n >= 1.0'); 67} 68if (1n <= 1.0) { 69 console.log('1n <= 1.0'); 70} 71if (1n == 1.0) { 72 console.log('1n == 1.0'); 73} 74 75let compareA6:boolean = true; 76compareA6 = 2n > 1.0 && 1n > 1.5 || 2n >= 2.0; 77 78const condition = true 79compareA6 = ((1n > 1.0) ? (1n < 1.0) : (1n >= 1.0)); 80compareA6 = ((1n <= 1.0) ? (1n == 1.0) : (1n > 1.5)); 81function comparePar2() { 82 return 5n > 5.0 || 5n < 5.0 || 5n >= 5.0 || 5n <= 5.0 || 5n == 5.0; 83}