数学。JavaScript 中的 fround() 函数
Math 对象的 fround() 函数接受一个浮点数并返回最近的 32 位单精度浮点数表示形式的一个数。如果给定的数字本身是整数,此函数将返回相同的值。
语法
语法如下:
Math.fround(160.98)
示例
<html>
<head>
<title>JavaScript Example</title>
</head>
<body>
<script type="text/javascript">
var result = Math.fround(160.98);
document.write("Fround value: "+result);
</script>
</body>
</html>输出
Fround value: 160.97999572753906
广告
数据结构
网络
RDBMS
操作系统
Java
iOS
HTML
CSS
Android
Python
C 编程
C++
C#
MongoDB
MySQL
Javascript
PHP