Solved

Overflow Run-time error

Posted on 2003-12-11
1
352 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Most everyone who has done any programming in VB6 knows that you can do something in code like Debug.Print MyVar and that when the program runs from the IDE, the value of MyVar will be displayed in the Immediate Window. Less well known is Debug.Asse…
Enums (shorthand for ‘enumerations’) are not often used by programmers but they can be quite valuable when they are.  What are they? An Enum is just a type of variable like a string or an Integer, but in this case one that you create that contains…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
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…

708 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

13 Experts available now in Live!

Get 1:1 Help Now