To register for an Internet.com membership to receive newsletters and white papers, use the Register button ABOVE.
To participate in the message forums BELOW, click here
VBForums  

VB Wire News
MSDN Subscribers: Download the VS 2010 Release Candidate
MSDN Subscribers: Download the VS 2010 Release Candidate
Sell Your Code and Make Money?
Creating your own Tetris game using VB.NET
Article :: Improving Software Economics, Part 4 of 7: Top 10 Principles of Iterative Software Management



Go Back   VBForums > Visual Basic > Visual Basic .NET

Reply Post New Thread
 
Thread Tools Search this Thread Display Modes
Old Nov 28th, 2009, 02:00 PM   #1
VBNetDude
Addicted Member
 
Join Date: Oct 09
Location: Clive, IA in America!!!!
Posts: 201
VBNetDude is an unknown quantity at this point (<10)
Resolved [RESOLVED] Large Numbers

Is there any container that would hold a number that is 10,000 characters in length? would I have to create one? If so how would I go about doing something like that?
__________________

VBNetDude - Thinking Programmatically
By Silver Seal Software

Don't forget to mark your thread as "Resolved" using the Thread Tools menu on top. And don't forget to rate the answers that help you the most!
VBNetDude is offline   Reply With Quote
Old Nov 28th, 2009, 02:33 PM   #2
ntg
Frenzied Member
 
ntg's Avatar
 
Join Date: Sep 04
Posts: 1,192
ntg is a jewel in the rough (200+)ntg is a jewel in the rough (200+)ntg is a jewel in the rough (200+)
Re: Large Numbers

You'll have to make one. In order to do that, you'll have to think in terms of how two bytes are combined together to form an integer (and from there extrapolate for an n-byte number). When you add to a 2-byte number you start by adding to the least significant byte - if you get a carry, you add that to the most significant byte.

It works exactly like elementary arithmetic. I imagine you can code something that works in base-10 arithmetic or something that would work with base-2 arithmetic (bytes). Coding for base-10 would be intuitive and simple while coding for base-2 arithmetic would be faster.
__________________
"Feel the force...read the source..."
Utilities: POPFileDebugViewProcess ExplorerWiresharkKeePassUltraVNCPic2Ascii
.Net tools & open source: DotNetNukelog4NetCLRProfiler
Customer quote: "If the server has a RAID array, why should we bother with backups?"
Programmer quote: "I never comment my code. Something that is hard to write should be impossible to comprehend."
ntg is offline   Reply With Quote
Old Nov 28th, 2009, 02:46 PM   #3
Pradeep1210
Power Poster
 
Pradeep1210's Avatar
 
Join Date: Apr 04
Location: Inside the CPU...
Posts: 4,301
Pradeep1210 is a splendid one to behold (700+)Pradeep1210 is a splendid one to behold (700+)Pradeep1210 is a splendid one to behold (700+)Pradeep1210 is a splendid one to behold (700+)Pradeep1210 is a splendid one to behold (700+)Pradeep1210 is a splendid one to behold (700+)Pradeep1210 is a splendid one to behold (700+)
Re: Large Numbers

Quote:
Originally Posted by VBNetDude View Post
Is there any container that would hold a number that is 10,000 characters in length? would I have to create one? If so how would I go about doing something like that?
If you don't need it for calculation purposes, store it as string.
__________________
Pradeep
If anyones answer has helped you please show your appreciation by rating that answer. Just click icon on the left of the post you wish to rate.

My Blog | 101 LINQ Samples | JSON Validator | XML Schema Validator | String Enum | "How Do I" videos on MSDN | VB.NET and C# Comparison

Some Signatures that contain Useful Stuff:
jmcilhinney | szlamany | MartinLiss | RobDog888 | dee-u | RhinoBull | si_the_geek | koolsid | Negative0 | VBDT | gep13 | NickThissen...
Pradeep1210 is online now   Reply With Quote
Old Nov 28th, 2009, 06:24 PM   #4
stanav
PowerPoster
 
stanav's Avatar
 
Join Date: Jul 06
Location: Providence, RI - USA
Posts: 6,848
stanav is a name known to all (1000+)stanav is a name known to all (1000+)stanav is a name known to all (1000+)stanav is a name known to all (1000+)stanav is a name known to all (1000+)stanav is a name known to all (1000+)stanav is a name known to all (1000+)stanav is a name known to all (1000+)
Re: Large Numbers

What kind of number is that big... I can't imagine if I never need to use one
Anyway, what's you're looking for is "Big Integer" type. If you're targeting .Net 4.0 then it's the System.Numerics.BigInteger structure. If you're targeting .Net 3.5 and lower, you have to create your own.
__________________
Let us have faith that right makes might, and in that faith, let us, to the end, dare to do our duty as we understand it.
- Abraham Lincoln -
stanav is online now   Reply With Quote
Old Nov 28th, 2009, 07:18 PM   #5
VBNetDude
Addicted Member
 
Join Date: Oct 09
Location: Clive, IA in America!!!!
Posts: 201
VBNetDude is an unknown quantity at this point (<10)
Re: Large Numbers

Um, I am working with a number that is 10,000 Digits in length. It must be prime. I made a prime number finder that went through the selected starting and ending points, and listed all the prime ones. Now I want to expand that and see how large I can make the number. (Can you tell I have nothing to do? )

Is there any way to import .Net 4.0 into VB 2008? I don't care what framework it targets because it is really just something to abide time until I have something better to do!
__________________

VBNetDude - Thinking Programmatically
By Silver Seal Software

Don't forget to mark your thread as "Resolved" using the Thread Tools menu on top. And don't forget to rate the answers that help you the most!
VBNetDude is offline   Reply With Quote
Old Nov 28th, 2009, 07:37 PM   #6
jmcilhinney
.NUT
 
jmcilhinney's Avatar
 
Join Date: May 05
Location: Sydney, Australia
Posts: 54,913
jmcilhinney has a reputation beyond repute (3000+)jmcilhinney has a reputation beyond repute (3000+)jmcilhinney has a reputation beyond repute (3000+)jmcilhinney has a reputation beyond repute (3000+)jmcilhinney has a reputation beyond repute (3000+)jmcilhinney has a reputation beyond repute (3000+)jmcilhinney has a reputation beyond repute (3000+)jmcilhinney has a reputation beyond repute (3000+)jmcilhinney has a reputation beyond repute (3000+)jmcilhinney has a reputation beyond repute (3000+)jmcilhinney has a reputation beyond repute (3000+)
Re: Large Numbers

Quote:
Originally Posted by VBNetDude View Post
Is there any way to import .Net 4.0 into VB 2008? I don't care what framework it targets because it is really just something to abide time until I have something better to do!
No, you would have to download and install VS 2010 Beta 2. If you do so, I would recommend installing on a virtaul machine if you possibly can. You should avoid installing any beta software on a system that you can't happily reformat.
__________________

2007, 2008, 2009, 2010

Why is my data not saved to my database? | Communicating between multiple forms | MSDN Data Walkthroughs
MSDN "How Do I?" Videos: VB | C#
VBForums Database Development FAQ
My CodeBank Submissions: VB | C# (ForumAccount has translated some of my VB submissions to C#)
My Blog: Defining and Raising Custom Events | Manipulating GDI+ Drawings | Using Parameters in ADO.NET
jmcilhinney is offline   Reply With Quote
Reply

Go Back   VBForums > Visual Basic > Visual Basic .NET


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT -5. The time now is 08:25 AM.




To view more projects, click here

Acceptable Use Policy


The Network for Technology Professionals

Search:

About Internet.com

Legal Notices, Licensing, Permissions, Privacy Policy.
Advertise | Newsletters | E-mail Offers

Powered by vBulletin® Version 3.8.1
Copyright ©2000 - 2010, Jelsoft Enterprises Ltd.