Mod Question
Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller
Mod Question
Is there a function to give the whole
part of the number?
I've done it with a bit of code but just
feel that it's in.
part of the number?
I've done it with a bit of code but just
feel that it's in.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
Re: Mod Question
Take the first word of your thread title and look that up in the dictionary!
Amazing, isn't it?
Amazing, isn't it?
Re: Mod Question
Well, if I put 22 mod 5 the answer is 2 - the remainder.
whereas 22/5 is 4.4. The answer I want is 4 not 2.
Just coded it to delete char "." and following numbers.
While on the subject I wonder has anyone found a use
for "mod" and if so what was it.
whereas 22/5 is 4.4. The answer I want is 4 not 2.
Just coded it to delete char "." and following numbers.
While on the subject I wonder has anyone found a use
for "mod" and if so what was it.
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.
-
- VIP Livecode Opensource Backer
- Posts: 9823
- Joined: Sat Apr 08, 2006 7:05 am
- Location: Los Angeles
- Contact:
Re: Mod Question
See trunc in the Dictionary.
Richard Gaskin
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
LiveCode development, training, and consulting services: Fourth World Systems
LiveCode Group on Facebook
LiveCode Group on LinkedIn
Re: Mod Question
When I saw this last night, I had assumed he had looked up 'mod' in the dictionary, and it hadn't answered his question. So I went and looked it up, and it doesn't answer his question.
I also did not know, but apparently there are more than one way to get to where Ross wanted to go. Of course, you would have to kind of know exactly what your looking for in this case to figure out what to look for in the dictionary.
I wonder now if you did not know, how would you find out heh.
Well, that one I can link to. Basically, mod does a lot of things, but what I used it for most was dividing things into equal pieces, like scaling a picture, centering a window, etc.
Re: Mod Question
Thanks guys for your help.
I ended up with what I think is a nifty bit of code...
This was to avoid a "divide by zero" error.
I ended up with what I think is a nifty bit of code...
Code: Select all
repeat with x = 8 to min(36,(field SCount div 4 * 4)) step 4
Is age an excuse? Eighty-four and counting.
Programming powered by coffee.
Programming powered by coffee.