473,326 Members | 2,732 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

Calculation Overflow

FNM
My calculation is CLng(56238749.9943 * 100), but it it overflow. How
to do oi right way ?
Nov 12 '05 #1
1 1682
fa*****@lycos.com (FNM) wrote in news:b2178b85.0402291951.26d91e14
@posting.google.com:
My calculation is CLng(56238749.9943 * 100), but it it overflow. How
to do oi right way ?


Your calculation would result in
5623874999 which is larger than maximum allowable long:
2147483647 is the
Depending on what you want to do,
Int(CDbl(56238749.9943 * 100))
may be useful.

--
Lyle
(for e-mail refer to http://ffdba.com/contacts.htm)
Nov 12 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: John Black | last post by:
Hi, If I have many integer calculation in my code, what's the best way to detect integer overflow? unsigned int i1 = 0xFFFFFF00, i2 = 0xFFFF; then in statement unsigned int i3 = i1 + i2;...
5
by: Jeff | last post by:
Dim lngWeights as long, lngBuckets as Long Const STDWEIGHTS = 12 lngBuckets = 1000 lngWeights = lngBuckets * STDWEIGHTS This causes an Overflow error. For lower values it works. Obviously...
14
by: wane | last post by:
Hello, I have heard that one should avoid using float and double in monetary calculation because of the lack of preciseness. What is a good alternative? Thanks
2
by: Miguel Morales | last post by:
Hello: Currently, I am trying to solve a problem that requires the calculation of Airy functions for big arguments. Because Airy functions diverge rapidly for positive values, the results of the...
3
by: linq936 | last post by:
Hi, I am writing my own integer data type because I need to check overflow. For example, if I have 2 very big unsigned int to add up, there might be overflow happening. So i will have my own...
3
by: linq936 | last post by:
I have some algorithm dealing with unsigned int calculation a lot, I am trying to add some check for overflow. The initial thinking was very easy, just do something like this, int...
28
by: beach.dk | last post by:
Hi, I'm trying to implement a simple hash algorith called rs_hash in javascript, but I cannot get a correct result. In c the code looks like this:
5
by: The alMIGHTY N | last post by:
Hi all, Let's say I have a simple math formula: sum (x * y / 1000) / (sum z / 1000) I have to do this across 50 items, each with an x, y and z value, when the page first loads AND when a...
49
by: seema | last post by:
Hi all, How to calculate upper 4 bytes and lower 4 bytes of a value? Can somebody please explain?? say for example, unsigned int scnlen_lo; int scnlen_hi; unsigned long long scnlen; ...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.