Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Senior Coder
    Join Date
    Dec 2005
    Location
    Slovenia
    Posts
    1,982
    Thanks
    120
    Thanked 76 Times in 76 Posts

    2*10e-11 --> 2*10e-10 ?

    this

    Code:
    alert(2*10e-11);
    alerts: 2*10e-10

    ?

  • #2
    Regular Coder
    Join Date
    Jun 2007
    Location
    USA
    Posts
    527
    Thanks
    26
    Thanked 74 Times in 72 Posts
    Code:
    1e2 = 1 * (10 ^ 2)
    Basically, the e already includes the 10 in the times part.

    In your example,

    Code:
    2*10e-11 
       = 2 * 10 * (10 ^ -11)
       = 2 * (10 ^ (-11 + 1))
       = 2 * (10 ^ -10)
       = 2e-10
    
       (which is what js alerts)
    Trinithis

  • #3
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    Yes...it's correct

    ...This means that 10 is raised to the power of -11 which is 0.0000000001

    The output above is exactly the same as:
    Code:
    alert(2*0.0000000001);
    Edit: Trinithis types fastly as the chimpanzee
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph

  • #4
    Regular Coder
    Join Date
    Jun 2007
    Location
    USA
    Posts
    527
    Thanks
    26
    Thanked 74 Times in 72 Posts
    The question is . . . do chimpanzee's type fast?
    Trinithis

  • #5
    Senior Coder rangana's Avatar
    Join Date
    Feb 2008
    Location
    Cebu City, Philippines
    Posts
    1,752
    Thanks
    65
    Thanked 372 Times in 365 Posts
    NOt as fast as you do
    Learn how to javascript at 02geek

    The more you learn, the more you'll realize there's much more to learn
    Ray.ph


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •