Re: How do I get the decimals?
Re: How do I get the decimals?
- Subject: Re: How do I get the decimals?
- From: Bernardo Hoehl <email@hidden>
- Date: Thu, 29 Jul 2004 19:00:29 -0300
Thanks Michelle!
That is what I was looking for.
I had a work around that doing a minus - repeat function.
But "MOD" is the right way to do it.
Thanks!
===================
On 29 de jul de 2004, at 18:55, Michelle Steiner wrote:
On Jul 29, 2004, at 1:54 PM, Bernardo Hoehl wrote:
set x to 266 div 11--- returns 24
the true calculation should return 24.18181818 or a rest of 2
Question: how do I get the rest of the calculation?
I don't follow; "div" is integer arithmetic; it's supposed to return
an integer. I don't understand what you mean by "or a rest of 2)
either. Do you mean the "mod" function. if so, that would be
266 mod 11
--> 2
The mod function is actually ((266 / 11 - 266 div 11) * 11) as integer
--> 2
If you want just the fraction,
266 / 11 - 266 div 11
--> 0.181818181818
-- Michelle
--
Impeach The Son Of A Bush!
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.