Results 1 to 3 of 3

Thread: longer numbers

  1. #1

    Thread Starter
    New Member
    Join Date
    Sep 2000
    Posts
    1

    Question

    I am trying to write a program involving very large numbers, but VB tries to round my numbers always after they reach a certain length. Is there any way using vb basic to use a number that will not round, and as it gets larger use more memory to hold it. I am pretty sure java and c++ can do it, but for this it would be a lot easier just to program using vb. Thanks for any help.

  2. #2
    Frenzied Member HarryW's Avatar
    Join Date
    Jan 2000
    Location
    Heiho no michi
    Posts
    1,827
    I often hear of people using currency data types to hold particularly large numbers (I think that's what they're talking about anyway) is there likely to be a limit to how large the value will be?
    Harry.

    "From one thing, know ten thousand things."

  3. #3
    transcendental analytic kedaman's Avatar
    Join Date
    Mar 2000
    Location
    0x002F2EA8
    Posts
    7,221
    You can use a variant (i know it's slow but this is for huge numbers) and convert it to decimal, a 96 bit datatype (that can only be stored in variants) It can store an integer with max 28 decimal places where smallest non0 value is
    +/-0.0000000000000000000000000001
    and largest values:
    +/-79,228,162,514,264,337,593,543,950,335

    Now the next step would be to store it in a byte array and do the calculations manually
    Use
    writing software in C++ is like driving rivets into steel beam with a toothpick.
    writing haskell makes your life easier:
    reverse (p (6*9)) where p x|x==0=""|True=chr (48+z): p y where (y,z)=divMod x 13
    To throw away OOP for low level languages is myopia, to keep OOP is hyperopia. To throw away OOP for a high level language is insight.

Posting Permissions

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



Click Here to Expand Forum to Full Width