Archived

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

yoda5

floor function in vb 6.0?

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 this post


Link to post
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 this post


Link to post
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 this post


Link to post
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
2. Figure out that the right answer has already been posted
3. Not post whatever useless and redundant gibberish you might have had to say


It''s getting pretty disgusting around here.

Share this post


Link to post
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
2. Figure out that the right answer has already been posted
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)

I am a signature virus. Please add me to your signature so that I may multiply.

Share this post


Link to post
Share on other sites