Results 1 to 2 of 2

Thread: Longs are too small!

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Oct 2005
    Location
    New York
    Posts
    94

    Longs are too small!

    So, here I am, working on number theory, thinking, "Ach, I hate doing aaaaalllllll this binomial expansion crud, I wish there was a program... "

    Duh! Whipped it up in about an hour.

    But than I try a daring exponent, something to the affect of 480505715157551513815415, long enough to throw an exception. Not enough space, o noes! What to do, what to do?

    I wasn't sure if there was a way to declare a variable with a different memory allocation, larger than the big bad 64 I got.

    Help is, as always, appreciated =)
    AZURE
    Act 1: Ruby
    Act 2: Cavara Militari
    Act 3:
    Act 4:
    Act 5: Cogito ergo sum

  2. #2
    Super Moderator jmcilhinney's Avatar
    Join Date
    May 2005
    Location
    Sydney, Australia
    Posts
    111,221

    Re: Longs are too small!

    Use the Decimal type:
    Holds signed 128-bit (16-byte) values representing 96-bit (12-byte) integer numbers scaled by a variable power of 10. The scaling factor specifies the number of digits to the right of the decimal point; it ranges from 0 through 28. With a scale of 0 (no decimal places), the largest possible value is +/-79,228,162,514,264,337,593,543,950,335 (+/-7.9228162514264337593543950335E+28). With 28 decimal places, the largest value is +/-7.9228162514264337593543950335, and the smallest nonzero value is +/-0.0000000000000000000000000001 (+/-1E-28).
    They are slower than other numerical types so should be avoided if not required, but if they are required then dive right in.
    Why is my data not saved to my database? | MSDN Data Walkthroughs
    VBForums Database Development FAQ
    My CodeBank Submissions: VB | C#
    My Blog: Data Among Multiple Forms (3 parts)
    Beginner Tutorials: VB | C# | SQL

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