Re: How do I get the decimals?
Re: How do I get the decimals?
- Subject: Re: How do I get the decimals?
- From: "Adam K. Wuellner" <email@hidden>
- Date: Thu, 29 Jul 2004 17:00:29 -0500
On Jul 29, 2004, at 3:54 PM, Bernardo Hoehl wrote:
Example:
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?
'div' is the integer division operator. It returns only the integer
portion of the division.
'mod' (for modulus) returns only the remainder portion.
'/' is the real division operator. It returns a real.
example:
set x to 5
set y to 3
set z to x div y -- z is 1
set z to x mod y -- z is 2
set z to x/y -- z is 1.66666666...
--
Adam
_______________________________________________
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.