diff --git a/uni_modules/uts-tests/utssdk/Math.uts b/uni_modules/uts-tests/utssdk/Math.uts index d35461e5ee20b01c4862f0f9ea63e555ea104374..769e38047151a3688ac517391f7942acfdde5a8c 100644 --- a/uni_modules/uts-tests/utssdk/Math.uts +++ b/uni_modules/uts-tests/utssdk/Math.uts @@ -125,9 +125,8 @@ export function testMath() : Result { // #END // 解决精度问题 expect(Math.acos(-1)).toEqual(3.141592653589793); - expect(Math.acos(NaN)).toEqual(NaN); expect(Math.acos(0)).toEqual(1.5707963267948966); - expect(Math.acos(1)).toEqual(0); + expect(Math.acos(1)).toEqual(0.0); }) test('acosh', () => { @@ -146,8 +145,7 @@ export function testMath() : Result { // expected output: 1.566799236972411 // #END // 解决精度问题 - expect(Math.acosh(1)).toEqual(0); - expect(Math.acosh(NaN)).toEqual(NaN); + expect(Math.acosh(1)).toEqual(0.0); expectNumber(Math.acosh(2)).toEqualDouble(1.3169578969248166); expectNumber(Math.acosh(2.5)).toEqualDouble(1.566799236972411); }) @@ -172,10 +170,9 @@ export function testMath() : Result { // expected output: 1.5707963267948966 // #END // 解决精度问题 - expect(Math.asin(NaN)).toEqual(NaN); expect(Math.asin(-1)).toEqual(-1.5707963267948966); // expect(Math.asin(0.5)).toEqual(0.5235987755982989); - expect(Math.asin(0)).toEqual(0); + expect(Math.asin(0)).toEqual(0.0); expect(Math.asin(1)).toEqual(1.5707963267948966); }) @@ -199,9 +196,8 @@ export function testMath() : Result { // expected output: 1.4436354751788103 // #END // 解决精度问题 - expect(Math.asinh(NaN)).toEqual(NaN); expectNumber(Math.asinh(1)).toEqualDouble(0.881373587019543); - expectNumber(Math.asinh(0)).toEqualDouble(0); + expectNumber(Math.asinh(0)).toEqualDouble(0.0); expectNumber(Math.asinh(-1)).toEqualDouble(-0.881373587019543); expectNumber(Math.asinh(2)).toEqualDouble(1.4436354751788103); }) @@ -220,9 +216,8 @@ export function testMath() : Result { // expected output: 0 // #END // 解决精度问题 - expect(Math.atan(NaN)).toEqual(NaN); expect(Math.atan(1)).toEqual(0.7853981633974483); - expect(Math.atan(0)).toEqual(0); + expect(Math.atan(0)).toEqual(0.0); }) test('atan2', () => { @@ -248,8 +243,7 @@ export function testMath() : Result { // expected output: 0 // #END // 解决精度问题 - expect(Math.atanh(NaN)).toEqual(NaN); - expect(Math.atanh(0)).toEqual(0); + expect(Math.atanh(0)).toEqual(0.0); // expect(Math.atanh(0.5)).toEqual(0.5493061443340548); }) @@ -284,7 +278,6 @@ export function testMath() : Result { // expected output: -37110233000 // #END expect(Math.ceil(0.95)).toEqual(1); - expect(Math.ceil(NaN)).toEqual(NaN); expect(Math.ceil(4)).toEqual(4); expect(Math.ceil(7.004)).toEqual(8); expect(Math.ceil(-7.004)).toEqual(-7);