From 37fc324f9bf1edabd53172cfb51b8b3be5bc7897 Mon Sep 17 00:00:00 2001 From: Aborn Jiang Date: Tue, 13 Sep 2022 14:36:19 +0800 Subject: [PATCH] commit by magit in emacs@2022-09-13 14:36:17 --- js/freq.ts | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/js/freq.ts b/js/freq.ts index e795b49..bd90f49 100644 --- a/js/freq.ts +++ b/js/freq.ts @@ -7,3 +7,13 @@ typeof '' === 'string'; 'blue ss'.indexOf('blue'); // str.substring(indexStart[, indexEnd]) + + +// 向下取整 floor +Math.floor( 45.95); // 45 +// 向上取整 ceil +Math.ceil(.95) // 1 + +// 给定数字的值四舍五入到最接近的整数。 +Math.round(20.49); //20 +Math.round(20.5); //21