Solved

C# Large numbers

Posted on 2006-06-23
3
308 Views
Last Modified: 2008-01-09
I'm trying to do this equastion: http://www.hackingspirits.com/cyb_forensic/fsic_articles/loc_place.html

However i keep getting a "The operation overflows at compile time in checked mode";

All are ok except for 16777216*202.  I've tried a few things, like doubles, ints longs and tried to make them unsigned aswell.  Is there a way to handle such large numbers?

If there isn't a standard .net way, my guess is i have to create my own class and catch how much overflow there is?
0
Comment
Question by:UnexplainedWays
3 Comments
 
LVL 142

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 500 total points
ID: 16974317
please try this:
16777216m * 202m
0
 
LVL 12

Author Comment

by:UnexplainedWays
ID: 16974329
           uint aaa = 202;
            uint bbb = 16777216;
            IP_Number = aaa * bbb;

It took the 202 and left it as a normal int.

I tried the m, it turns the numbers into a decimal, and if i turn the origional number into a decimal that works 2.
Thanks.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…

785 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question