Solved

Overflow Run-time error

Posted on 2003-12-11
1
354 Views
Last Modified: 2010-05-01
Hi,

I would like to get the rest of division very big number with 30 digits
for example 116022440020551020156789252100

- I don't want to represent this numer by any approximation in the form 1.16022440020551E+29
- I received Run-time error '6' Overflow

Code:

Dim rest As Long

rest = 1.16022440020551E+29 Mod 97

If I change

rest = 1.16022440020551E+29 - Int(1.16022440020551E+29 /97) *97

always the result is equal 0
0
Comment
Question by:marekcz
1 Comment
 
LVL 7

Accepted Solution

by:
Smallint earned 125 total points
ID: 9919580

You cannot handle such huge number directly in VB

If you do not want approximations biggest datatype is Currency

with values between – 922.337.203.685.477,5808 and 922.337.203.685.477,5807.


If you need more you must develop your own operators.


Cheers
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

There are many ways to remove duplicate entries in an SQL or Access database. Most make you temporarily insert an ID field, make a temp table and copy data back and forth, and/or are slow. Here is an easy way in VB6 using ADO to remove duplicate row…
You can of course define an array to hold data that is of a particular type like an array of Strings to hold customer names or an array of Doubles to hold customer sales, but what do you do if you want to coordinate that data? This article describes…
Show developers how to use a criteria form to limit the data that appears on an Access report. It is a common requirement that users can specify the criteria for a report at runtime. The easiest way to accomplish this is using a criteria form that a…
This lesson covers basic error handling code in Microsoft Excel using VBA. This is the first lesson in a 3-part series that uses code to loop through an Excel spreadsheet in VBA and then fix errors, taking advantage of error handling code. This l…

911 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now