Results 1 to 9 of 9

Thread: really really really big numbers in VB?

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Location
    Phoenix
    Posts
    87
    lets say i need to work iwth integers in the nonillion range (1,000,000,000,000,000,000,000,000,000,000) in a for loop.. has anyone developed a class to handle this sort of thing? i know it doesn't sound realistic to have a for loop that long but i need to use it!

    is there anything i can do?

  2. #2

    Thread Starter
    Lively Member
    Join Date
    Jul 1999
    Location
    Phoenix
    Posts
    87

    Question darnit wrong forum

    can a moderator move this to the general programming foruM?

  3. #3
    Guest
    Declare it as Double. Integers will only give you around 32,000. Using Double will give you a number somewhat like the one you specified.

    Code:
    Dim MyValue as Double
    [Edited by Megatron on 05-18-2000 at 05:43 PM]

  4. #4
    Guest
    i have a book (vb6 win32 api tutorial by jason bock, wrox presS)
    he uses UDT's to express big numbers, he dunnit like this

    Code:
    type thisthing
    lower32 as long
    higher32 as long
    that makes it like 64 bits or something.... I am not very sure, the author didnt really say how to use it, he just said something about it.

  5. #5
    Guest
    oops.....


    Code:
    end type

  6. #6
    Guest
    Yes, but you could just type one word and make it 64 bits.
    Currency is 64 bits and I think Double is 96 bits.

  7. #7
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    no, a currency is only 64 bits, Dennis, when Jason Bock uses his LARGE_INTEGER use a currency instead, it makes the maths so much easier.

    also, watch for memory leaks in his code, he forgets some deleteobjects etc.

    Other than that it's a great book, those of you thinking of buying it, don't be discouraged by the scary picture on the front.

    [Edited by Sam Finch on 05-19-2000 at 12:32 AM]

  8. #8
    Guest

    no, a currency is only 64 bits
    Yes, that's what I said, didn't I?

  9. #9
    Frenzied Member
    Join Date
    Mar 2000
    Posts
    1,089
    I meant a double is 64 bits, I just forgot what I meant while typing.

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