• 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: Malcolm Fitzgerald <email@hidden>
  • Date: Mon, 19 Aug 2002 14:08:46 +1000

On Monday, August 19, 2002, at 01:26 PM, Deivy Petrescu wrote:

At 7:36 PM -0700 8/18/02, Paul Berkowitz wrote:
On 8/18/02 7:23 PM, "Christopher Nebel" <email@hidden> wrote:

Can anyone give me an easy way to get the Int of a number, converting,
for instance, 6.1 into 6?

"round" from Standard Additions will do what you want.

Any particular reason why you favor an Addition over the native AppleScript

div 1

which I sent in? If you repeating it hundreds - or thousands - of times, div
1 will be much faster. Is it fragile in some way I don't know of?

--
Paul Berkowitz

Funny you should ask this Paul.
Since any number x can be writen as x=(x div 1) + (x mod 1) , then the fact that mod has a problem would imply that div have a problem.

This doesn't show any errors under OS10.1.5, AS "1.8.1"

repeat with x from 1.0 to 1.0E+4
repeat with y from 1 to 9
set z to x + y / 10
z div 1
end repeat
end repeat

--
Malcolm Fitzgerald email@hidden
Database Manager http://www.asauthors.org
The Australian Society of Authors ph: 02 93180877 fax: 02 93180530
_______________________________________________
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.
References: 
 >(was Int Function) mod bug (From: Deivy Petrescu <email@hidden>)

  • Prev by Date: AppleScript Try
  • Next by Date: Setting the bundle package bit
  • Previous by thread: Re: (was Int Function) mod bug
  • Next by thread: Re: Int Function
  • Index(es):
    • Date
    • Thread