# Help with dividing numbers in a different way

#### isk2837

##### Member
Longtime User
I know how to divide one number by another, but how do I do it in a way that only keeps the number of times that x divides into y, without the remainder?

#### Mahares

##### Expert
Longtime User
Are you thinking something simple like this using Round:
B4X:
``````Dim var1,var2 As Double
Dim varResult As Int
var1=74
var2=17
varResult= Round(var1/var2)
Msgbox(varResult,"")``````

It yields: VarResult=4 without decimals

##### Active Member
Longtime User
That will will show the answer rather than the amount of times x divides into y.

If I understand you correctly, this should do it:

B4X:
``````Dim a As Double
a = Floor(Logarithm(x,y))``````

With this, if x = 15 and y = 2 then a = 3.

And Mahares example - x = 71 and y = 17 then a = 1.

#### barx

##### Well-Known Member
Longtime User
Ahh the integer divide "/" function.

Can't say I've seen it in b4a. I'm usually wrong though.

#### barx

##### Well-Known Member
Longtime User
Just checked it out and yes it does work.

B4X:
``````dim x, y, Result as int

x = 45
y = 4

Result = x / y

log("Result = " & Result)``````

Show in log "Result = 11"

Android Question Divide buttons on a panel
Replies
4
Views
533
Replies
3
Views
12K
Replies
48
Views
37K
Replies
263
Views
501K
Replies
111
Views
185K