admin管理员组

文章数量:1193972

This example .html has following code:

function run() {
                e.animate({along: 1}, 2e4, function () {
                    e.attr({along: 0});
                    setTimeout(run);
                });
            }

What means "2e4" in this example and how it works?

This example http://raphaeljs.com/gear.html has following code:

function run() {
                e.animate({along: 1}, 2e4, function () {
                    e.attr({along: 0});
                    setTimeout(run);
                });
            }

What means "2e4" in this example and how it works?

Share Improve this question asked Apr 25, 2013 at 7:56 EvolEvol 1131 gold badge1 silver badge5 bronze badges 1
  • 2 @Baszz: unless prefixed with 0x, it's not hexadecimal. – David Titarenco Commented Apr 25, 2013 at 8:01
Add a comment  | 

2 Answers 2

Reset to default 21

it means 2*10^4
and try it in your console 2e4 the output will be 20000

the e is the scientific notation

the code is equivilant to

...
e.animate({along: 1}, 20000, function () { ....

2e4 is scientific notation for 2 * 10^4, and therefore has the same value as 20000.

本文标签: javascriptWhat means 392e439 in codeStack Overflow