• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: How do I get the decimals?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How do I get the decimals?


  • Subject: Re: How do I get the decimals?
  • From: Dave Stewart <email@hidden>
  • Date: Thu, 29 Jul 2004 15:10:48 -0700

On Jul 29, 2004, at 2:35 PM, Bernardo Hoehl pondered:

Example:

set x to 266 div 11--- returns 24

Yup, expected result with integer division (div).

the true calculation should return 24.18181818 or a rest of 2

Sounds like what you're looking for is:

set x to 266/11 --floating point division; results in x = 24.18181818

Question: how do I get the rest of the calculation?

I may have missed the point, so just in case you wanted the remainder and not the exact number try this:

set x to 266 mod 11 --modulus, or remainder from integer division; results in x = 2

Thanks

Anytime (although I'm probably late to the party here, due to the fact I'm on digest mode. If so I apologize)


Dave Stewart
Aqua~Flo Supply (Goleta CA)
dstewart at aquaflo dot com

Psychiatrists say that 1 out of 4 people are mentally ill.
Check 3 friends. If they're OK, you're it.
_______________________________________________
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.


  • Prev by Date: Re: Fwd: Too simple to find an answer for...
  • Next by Date: Re: How do I get the decimals?
  • Previous by thread: Re: How do I get the decimals?
  • Next by thread: Re: How do I get the decimals?
  • Index(es):
    • Date
    • Thread