Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 343
  • Last Modified:

Member of An Array of Numbers Has # Following Number

I have an array of numbers that are the results of the powers of two. All is well until the 31st entry and then the number gets a "#" appended to the number. The actual number is 2^31 or 2,147,483,648. Is there a limit to the size of a number that can be placed in an array? What is the significance of the "#" sign?

val1 = Array(1, 2, 4, 8, 16, _
             32, 64, 128, 256, 512, _
             1024, 2048, 4096, 8192, 16384, _
             32768, 65536, 131072, 262144, 524288, _
             1048576, 2097152, 4194304, 8388608, 16777216, _
             33554432, 67108864, 134217728, 268435456, 536870912, _
             1073741824, 2147483648#, 4294967296#, 8589934592#)
0
wmckinney
Asked:
wmckinney
  • 2
1 Solution
 
Patrick MatthewsCommented:
The # indicates that the value is treated as data type Double.  The Long data type tops out at (2 ^ 31) - 1.
0
 
Patrick MatthewsCommented:
BTW, Double tops out at ~1.79 x 10 ^ 308.  However, it is only precise to the first 15 significant digits.
0

Featured Post

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now