Web Analytics Made Easy -
StatCounter Handling large numbers in JavaScript - CodingForum

Announcement

Collapse
No announcement yet.

Handling large numbers in JavaScript

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Handling large numbers in JavaScript

    Hi All,

    I am stuck with handling large numbers in JavaScript. If I try to OR 3305111602 and 65535, I get a negative number. I do not know the reason. What is the highest positive number that Javascript can handle. Can any one help me with this. Thanks.

    Regards
    Srivats.

  • #2
    Certainly larger than that. Somewhere on the order of 1.79e308

    What do you mean you try to "OR" them?
    My Site | fValidate | My Brainbench | MSDN | Gecko | xBrowser DOM | PHP | Ars | PVP
    “Minds are like parachutes. They don't work unless they are open”
    “Maturity is simply knowing when to not be immature”

    Comment


    • #3
      alert(Number.MAX_VALUE);

      Can you show some codes?
      Glenn
      vBulletin Mods That Rock!

      Comment


      • #4
        Why does javascript have a maximum value?
        Has it got something to do with the number of digits it can remember at once?
        Shawn

        Comment


        • #5
          It's got to do with the IETF floating point numbers standard.
          liorean <[[email protected]]>
          Articles: RegEx evolt wsabstract , Named Arguments
          Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
          Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

          Comment


          • #6
            And what is IETF floating point numbers standard?
            Shawn

            Comment


            • #7
              Sorry, I had my acronyms messed up. IETF -> IEEE. IEEE 754 is the floating point number standard. It's a standard for how to encode numbers, used by almost all environments, It is the one used for floating point numbers in C99 (The international C standard), for instance. It has a few problems with rounding and such, but is otherwise a pretty good overall format, aiming at being both lightweight and cover as much as possible.
              liorean <[[email protected]]>
              Articles: RegEx evolt wsabstract , Named Arguments
              Useful Threads: JavaScript Docs & Refs, FAQ - HTML & CSS Docs, FAQ - XML Doc & Refs
              Moz: JavaScript DOM Interfaces MSDN: JScript DHTML KDE: KJS KHTML Opera: Standards

              Comment

              Working...
              X