• 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 to coerce a real to an integer in X?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to coerce a real to an integer in X?


  • Subject: Re: How to coerce a real to an integer in X?
  • From: Arthur J Knapp <email@hidden>
  • Date: Fri, 01 Feb 2002 14:44:44 -0500

> Date: Fri, 01 Feb 2002 14:28:58 +1100
> Subject: Re: How to coerce a real to an integer in X?
> From: Shane Stanley <email@hidden>

> On 1/2/02 2:18 PM +1000, Bob.Kalbaugh, email@hidden, wrote:
>
>> FWIW - OMM - 9.0/1.4:
>>
>> integer (3.5)
>> --> 4

> I still suspect a third-party do-dad. From ASLG (the old print one):
>
> "AppleScript supports coercion of a Real value to an Integer value only if
> the Real value has no fractional part."

And therefore, the behavior of coercing a real-with-fractional-part
to an integer should be considered "undefined".

Except when it works in your favor:

on RoundNumber(x)
return {x} as integer
end RoundNumber

RoundNumber(3.5) --> 4


;-)


{ Arthur J. Knapp, of <http://www.STELLARViSIONs.com>
<mailto:email@hidden>
try
<http://www.goodbuddy.net/budco/sware/imscripts.htm>
on error number -128
end try
}


  • Prev by Date: FMP Merge Data
  • Next by Date: Re: Pause script until application is finished
  • Previous by thread: Re: How to coerce a real to an integer in X?
  • Next by thread: Re: How to coerce a real to an integer in X?
  • Index(es):
    • Date
    • Thread