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 16declare function print(arg:any):string; 17let len:number = 1; 18len = 1 / Math.sqrt(len); 19print(len); 20 21len = 9 / len; 22len = Math.sqrt(len); 23print(len); 24print(NaN); 25len = Math.sqrt(NaN); 26print(len); 27 28len = Math.cos(0); // 1 29print(len); 30len = Math.cos(1); // 0.5.... 31print(len); 32 33len = Math.sin(0); // 0 34print(len); 35len = Math.sin(1); // 0.84 36print(len); 37len = Math.sin(Math.PI / 2); 38print(len); 39 40len = Math.acos(0.5);// 1.0471975511965979 41print(len); 42 43len = Math.atan(2); // 1.1071487177940904 44print(len); 45 46len = Math.abs(Number.NaN); 47print(len); 48len = Math.abs(-Number.NaN); 49print(len); 50len = Math.abs(Number.NEGATIVE_INFINITY); 51print(len); 52len = Math.abs(Number.POSITIVE_INFINITY); 53print(len); 54len = Math.abs(9.6); 55print(len); 56len = Math.abs(6); 57print(len); 58len = Math.abs(-9.6); 59print(len); 60len = Math.abs(-6); 61print(len); 62 63len = Math.floor(Number.NaN); 64print(len); 65len = Math.floor(-Number.NaN); 66print(len); 67len = Math.floor(Number.NEGATIVE_INFINITY); 68print(len); 69len = Math.floor(Number.POSITIVE_INFINITY); 70print(len); 71len = Math.floor(9.6); 72print(len); 73len = Math.floor(-9.6); 74print(len);