1/* 2 * Copyright (c) 2024 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 16export class binary_operations { 17 private sum1 : int = 3 + 2; 18 private sum2 : int = 3 + 2 - 4 + 1; 19 private sub1 : int = 8 - 3; 20 private sub2 : int = 8 - 3 + 8; 21 private rem1 : int = 5 % 3; 22 private rem2 : int = 5 % 3 - 2 * 8; 23 private mult1 : float = 6.2 * 3.14; 24 private mult2 : double = 6.2 * (3.7 + 8.18) / 2.2; 25 private div1 : float = 4.2 / 2.3; 26 private div2 : double = 4.2 / (2.2 - 0.1) + (3.3 / 6.1); 27 private lsh : int = 7 << 2; 28 private rsh1 : int = 7 >> 2; 29 private rsh2 : int = 7 >>> 2; 30 private bit1 : int = 7 & 3; 31 private bit2 : int = 7 | 3; 32 private bit3 : int = 7 ^ 3; 33 private b1 : boolean = 3 < 8; 34 private b2 : boolean = 3 <= 7; 35 private b3 : boolean = 3 >= 7; 36 private b4 : boolean = 3 > 8; 37 private b5 : boolean = 7 == 8; 38 private b6 : boolean = 7 != 4; 39 private b7 : boolean = (7 < 3) && (8 > 1); 40 private b8 : boolean = (7 < 3) || (8 > 1); 41} 42