• 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: Michelle Steiner <email@hidden>
  • Date: Thu, 29 Jul 2004 14:55:23 -0700

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.


  • Follow-Ups:
    • Re: How do I get the decimals?
      • From: "Adam K. Wuellner" <email@hidden>
    • Re: How do I get the decimals?
      • From: Bernardo Hoehl <email@hidden>
References: 
 >How do I get the decimals? (From: Bernardo Hoehl <email@hidden>)

  • Prev by Date: Finder broken
  • Next by Date: Re: How do I get the decimals?
  • Previous by thread: How do I get the decimals?
  • Next by thread: Re: How do I get the decimals?
  • Index(es):
    • Date
    • Thread