|
-
Mar 10th, 2012, 12:34 PM
#1
[RESOLVED] Odd Round behaviour
Something odd I've noticed in VBA.
If you evaluate Round(16 * 1000/100,1) you will get 160.
If you do Round(16 * 10000/1000,1) you will generate an overflow exception.
If you put a tiny decimal in, though, you will be fine.
Round(16.0001 * 10000/1000,1) = 160
There must be some form of coercion to an integer form with a specific number of bytes if you don't use a decimal, which then trips the overflow.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|