Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

C# Large numbers

Posted on 2006-06-23
3
Medium Priority
?
337 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 143

Accepted Solution

by:
Guy Hengel [angelIII / a3] earned 2000 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

Free Tool: Site Down Detector

Helpful to verify reports of your own downtime, or to double check a downed website you are trying to access.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

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

Introduction Hi all and welcome to my first article on Experts Exchange. A while ago, someone asked me if i could do some tutorials on object oriented programming. I decided to do them on C#. Now you may ask me, why's that? Well, one of the re…
The article shows the basic steps of integrating an HTML theme template into an ASP.NET MVC project
Add bar graphs to Access queries using Unicode block characters. Graphs appear on every record in the color you want. Give life to numbers. Hopes this gives you ideas on visualizing your data in new ways ~ Create a calculated field in a query: …
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…

715 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