提交 24d47041 编写于 作者: 杜庆泉's avatar 杜庆泉

math.round 示例添加

上级 b4b4bc52
...@@ -236,5 +236,10 @@ export function testMath(): Result { ...@@ -236,5 +236,10 @@ export function testMath(): Result {
expect(Math.trunc(42.84)).toEqual(42); expect(Math.trunc(42.84)).toEqual(42);
expect(Math.trunc(0.123)).toEqual(0); expect(Math.trunc(0.123)).toEqual(0);
}) })
test('round', () => {
expect(Math.round(0.9).toEqual(1));
expect(Math.round(5.95)).toEqual(6);
expect(Math.round(-5.05)).toEqual(-5);
})
}) })
} }
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册