floor function in vb 6.0?

Started by
7 comments, last by yoda5 20 years, 10 months ago
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
Advertisement
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
--Michael Fawcett
It''s called Int():

Number = 99 / 10
MsgBox Int(Number)

produces 9.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

What''s the matter with you?
Why start talking about the C-standard library here, in a thread about VB 6.0?

My game: Swift blocks
DISCLAIMER: If any of the above statements are incorrect, feel free to deliver me a good hard slap!My games: DracMan | Swift blocks
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
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
-~-The Cow of Darkness-~-
Number = 99\10, where \ means int.div.

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.

Wielder of the Sacred Wands
[Work - ArenaNet] [Epoch Language] [Scribblings]

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.
---Just trying to be helpful.Sebastian Beschkehttp://randomz.heim.at/

This topic is closed to new replies.

Advertisement