#### Archived

This topic is now archived and is closed to further replies.

# floor function in vb 6.0?

This topic is 5531 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

## Recommended Posts

I was just wondering if there is a min function for VB 6.0? I am sure there is, but the book I have is just too basic and the website tutorials I have found leave a lot to be desired. Basically I want 99 / 10, to be 9, in my program it is getting rounded up to 10. Thanks guys

##### Share on other sites
It''s been a while for me and I don''t have VB handy, but can''t you just do integer division? (i.e. 99 \ 10)

Also, you could just cast the result to an Int. This is from the MSDN...

Dim MyNumber as Int
MyNumber = Int(99.8) '' Returns 99

##### Share on other sites
It''s called Int():

Number = 99 / 10
MsgBox Int(Number)

produces 9.

##### Share on other sites
What''s the matter with you?

My game: Swift blocks

##### Share on other sites
Thanks again guys...I had to change one variable to a float and then cast it to an int to get what I wanted, but once again you guys got me on the right path.

Thanks again

##### Share on other sites
quote:
Original post by Jambolo
There are floor and ceil functions in the standard C math library.

C!=VB 6.0 last time I checked.

-~-The Cow of Darkness-~-

If you see the image I am online

##### Share on other sites
Number = 99\10, where \ means int.div.

##### Share on other sites
quote:
Original post by kspbergstrom
Number = 99\10, where \ means int.div.

What if he wants the floor of any arbitrary float?

Jeez you guys. It doesn''t take that much effort to read a thread, and:

1. Figure out that special-case instructions and C libraries aren''t the right answer
3. Not post whatever useless and redundant gibberish you might have had to say

It''s getting pretty disgusting around here.

##### Share on other sites
quote:
Original post by ApochPiQ
Jeez you guys. It doesn''t take that much effort to read a thread, and:

1. Figure out that special-case instructions and C libraries aren''t the right answer
3. Not post whatever useless and redundant gibberish you might have had to say

It''s getting pretty disgusting around here.

lool - good one!
Everyone in this thread so far has been more constructive than you have...

Sorry, just had to be destructive. But really, point #3...
I don''t think there''s something wrong with posting duplicate answers.

My Wonderful Web Site (C++ SDL OpenGL Game Programming)

1. 1
2. 2
Rutin
24
3. 3
4. 4
JoeJ
18
5. 5

• 14
• 17
• 11
• 11
• 9
• ### Forum Statistics

• Total Topics
631758
• Total Posts
3002155
×