8e3评估的数字是多少? [英] What number does 8e3 evaluate to?

查看:736
本文介绍了8e3评估的数字是多少?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我今天遇到了这个代码:

I encountered this code today:

b = setTimeout(function () {
    // do some javascript stuff here
}, 8e3)

超时设置为 8E3 。这段时间等于几毫秒,为什么有人会选择这种奇怪的符号?代码似乎功能齐全。

The timeout is set to 8e3. What time does this equate to in milliseconds, and why would anyone choose this strange notation? The code appears to be fully functional.

推荐答案

8e3 是八次10到3的幂,即8000.这称为科学(或指数)符号。试想一下,e代表* 10 ^。

8e3 is eight times ten to the power of three, that is, 8000. This is called scientific (or exponential) notation. Just imagine the "e" stands for "*10^".

在这种情况下,使用这种表示法并没有太大意义,但是一旦你开始变大数字,指数表示法变得更具可读性。要计算出1000000000是多少,你必须计算零,但1e9是显而易见的。

In this case there isn't much point in using that notation, but once you start getting to larger numbers, exponential notation becomes more readable. To figure out how much "1000000000" is you'd have to count zeros, but 1e9 is immediately obvious.

这篇关于8e3评估的数字是多少?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆