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