• 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: (was Int Function) mod bug
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: (was Int Function) mod bug


  • Subject: Re: (was Int Function) mod bug
  • From: email@hidden (Michael Sullivan)
  • Date: Mon, 19 Aug 2002 19:22:43 -0400
  • Organization: Society for the Incurably Pompous

email@hidden (Deivy Petrescu) writes:

> set x to 62
> set b to ((x + (2.6 - (2.6 mod 1))) - x) as integer
>
> now try this:
>
> set x to 61
> set b to ((x + (2.6 - (2.6 mod 1))) - x) as integer

I ran into this in PseudoRand, and some other similar code.
AFAICT, this never produces a bad answer:

set x to 61
set b to (((x + (2.6 - (2.6 mod 1))) - x) div 1) as integer


Michael

--
Michael Sullivan
Business Card Express of CT Thermographers to the Trade
Cheshire, CT email@hidden
_______________________________________________
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: (was Int Function) mod bug
      • From: email@hidden (Michael Sullivan)
References: 
 >(was Int Function) mod bug (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: Re: Traversing Directories/Searching
  • Next by Date: Re: getting a file list in sorted order
  • Previous by thread: Re: (was Int Function) mod bug
  • Next by thread: Re: (was Int Function) mod bug
  • Index(es):
    • Date
    • Thread