Howdy,
I feel quite embarrased asking this question, but for the life of me i can't
figure this out. I haven't run a debug, but I think what is happening is
that i'm doing some division and its rounding up when necessary, for
example.
Dim i as integer
Dim r as integer
i = 30 / 8
r = 30 mod 8
from what I can see in the way my code is responding, i is equal to 4, not
3. The mod works correctly, returns 6. How do i get this stupid thing to
work?
Thanks!
David Lozzi 5 1331
On May 3, 11:18 pm, "David Lozzi" <dlo...@nospam.nospamwrote:
Howdy,
I feel quite embarrased asking this question, but for the life of me i can't
figure this out. I haven't run a debug, but I think what is happening is
that i'm doing some division and its rounding up when necessary, for
example.
Dim i as integer
Dim r as integer
i = 30 / 8
r = 30 mod 8
from what I can see in the way my code is responding, i is equal to 4, not
3. The mod works correctly, returns 6. How do i get this stupid thing to
work?
Thanks!
David Lozzi
30 \ 8
Dim i As Integer
i = Math.Floor(30 / 8)
output for i is 3.
On May 3, 4:18 pm, "David Lozzi" <dlo...@nospam.nospamwrote:
Howdy,
I feel quite embarrased asking this question, but for the life of me i can't
figure this out. I haven't run a debug, but I think what is happening is
that i'm doing some division and its rounding up when necessary, for
example.
Dim i as integer
Dim r as integer
i = 30 / 8
r = 30 mod 8
from what I can see in the way my code is responding, i is equal to 4, not
3. The mod works correctly, returns 6. How do i get this stupid thing to
work?
Thanks!
David Lozzi
Alexey's solution should be more efficient as Math.Floor returns a
double.
On May 3, 5:02 pm, carion1 <ddavi...@gmail.comwrote:
Dim i As Integer
i = Math.Floor(30 / 8)
output for i is 3.
On May 3, 4:18 pm, "David Lozzi" <dlo...@nospam.nospamwrote:
Howdy,
I feel quite embarrased asking this question, but for the life of me i can't
figure this out. I haven't run a debug, but I think what is happening is
that i'm doing some division and its rounding up when necessary, for
example.
Dim i as integer
Dim r as integer
i = 30 / 8
r = 30 mod 8
from what I can see in the way my code is responding, i is equal to 4, not
3. The mod works correctly, returns 6. How do i get this stupid thing to
work?
Thanks!
David Lozzi- Hide quoted text -
- Show quoted text -
On May 4, 12:05 am, carion1 <ddavi...@gmail.comwrote:
Alexey's solution should be more efficient as Math.Floor returns a
double.
On May 3, 5:02 pm, carion1 <ddavi...@gmail.comwrote:
Dim i As Integer
i = Math.Floor(30 / 8)
output for i is 3.
On May 3, 4:18 pm, "David Lozzi" <dlo...@nospam.nospamwrote:
Howdy,
I feel quite embarrased asking this question, but for the life of me i can't
figure this out. I haven't run a debug, but I think what is happening is
that i'm doing some division and its rounding up when necessary, for
example.
Dim i as integer
Dim r as integer
i = 30 / 8
r = 30 mod 8
from what I can see in the way my code is responding, i is equal to 4, not
3. The mod works correctly, returns 6. How do i get this stupid thing to
work?
Thanks!
David Lozzi- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
well, it depends what he need to get
i = Int(30 / 8) will do the same result (3) as an integer division
operator "\"
Perfect. Thank you all!!
"Alexey Smirnov" <al************@gmail.comwrote in message
news:11**********************@n76g2000hsh.googlegr oups.com...
On May 4, 12:05 am, carion1 <ddavi...@gmail.comwrote:
>Alexey's solution should be more efficient as Math.Floor returns a double.
On May 3, 5:02 pm, carion1 <ddavi...@gmail.comwrote:
Dim i As Integer
i = Math.Floor(30 / 8)
output for i is 3.
On May 3, 4:18 pm, "David Lozzi" <dlo...@nospam.nospamwrote:
Howdy,
I feel quite embarrased asking this question, but for the life of me
i can't
figure this out. I haven't run a debug, but I think what is happening
is
that i'm doing some division and its rounding up when necessary, for
example.
Dim i as integer
Dim r as integer
i = 30 / 8
r = 30 mod 8
from what I can see in the way my code is responding, i is equal to
4, not
3. The mod works correctly, returns 6. How do i get this stupid thing
to
work?
Thanks!
David Lozzi- Hide quoted text -
- Show quoted text -- Hide quoted text -
- Show quoted text -
well, it depends what he need to get
i = Int(30 / 8) will do the same result (3) as an integer division
operator "\" This thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Michael Cornelius |
last post by:
As an old C programmer, I'm surprised by some results I'm getting with
integer division. For example:
>>> -1/1000
-1
>>> -9/2
-5
I expect the results of these expressions to be 0 and -4,...
|
by: joel |
last post by:
I have a table which I want to update by dividing one field into
another. The update runs with no errors, but the results come out as
only a positive integer number.
The datatype for the result...
|
by: Marcin |
last post by:
How I can make division of two numbers placed in arrays, example:
short int a = {2,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,2};
short int b =...
|
by: nessuno |
last post by:
I can't find any discussion of this question in this NG.
I'd like to implement some variable precision integer arithmetic in C,
and do it efficiently. A problem arises with the divide/remainder...
|
by: seb.haase |
last post by:
Hi,
Is it true that that "Python 3000" is dead ?
Honestly I think that e.g. changing 5/2 to be 2.5 (instead of 2) would
just break to much code :-(
On the otherhand I'm using Python as "Matlab...
|
by: Mike S |
last post by:
Does anyone know the logic behind why in VB.NET the result of a
floating-point division ('/') is -rounded- on being converted to an
integer type, such as with statements like
Dim x As Integer =...
|
by: kermit |
last post by:
For a long time,, There has been a discussion of trueFor division
versus integer division in Python.
I myslef prefer that / be used for integer division since almost
always, I want the...
|
by: jamesonang |
last post by:
Supposed unsigned int(32 bits) is the largest number that computer can
represent with a single variable.
Now, i have a big integer ( less than 64 bit, but great than 32 bit) .
i represent it by...
|
by: ryjfgjl |
last post by:
ExcelToDatabase: batch import excel into database automatically...
|
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...
|
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...
|
by: ArrayDB |
last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
|
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)...
|
by: CloudSolutions |
last post by:
Introduction:
For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
|
by: af34tf |
last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
|
by: Faith0G |
last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
|
by: isladogs |
last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM).
In this session, we are pleased to welcome former...
| |