No announcement yet.

Working with big number variables

  • Filter
  • Time
  • Show
Clear All
new posts

  • Working with big number variables

    Dear Support,

    if I will convert my 2863000600000005 string with String.ToNumber(Target); I'm getting as result 2.863e+015 instead of 2863000600000005 number...
    How can i resolve this kind of "bug"?

    Thank you

  • #2
    Why is it problem?
    Because I would convert is back to string, but in this case can not :(


    • #3
      If you are telling it to convert to a number then that is what it has done, it isn't a bug just a limitation of the maths libraries used.
      What you weren't expecting was that it would be as a 16bit value ( binary 1111111111111111 = max 65535) unless you reproduce the number in scientific notation which looses you some precision. 32bits still only gives you a max of 2,147,483,647, 64bits takes you to a max of 18,446,744,073,709,551,615.
      If they are in variables with a different names then you have both values, it only changes when you call it a number.


      • #4
        You could use an arbitrary precision library, see attachment.
        Attached Files
        Bas Groothedde
        Imagine Programming :: Blog

        AMS8 Plugins
        IMXLH Compiler


        • #5
          Originally posted by Imagine Programming View Post
          You could use an arbitrary precision library, see attachment.
          Thank you, it works