• 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: newbie question: real with fraction to int
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: newbie question: real with fraction to int


  • Subject: Re: newbie question: real with fraction to int
  • From: Nigel Garvey <email@hidden>
  • Date: Sat, 25 Oct 2003 11:44:48 +0100

Arthur Knapp wrote on Fri, 24 Oct 2003 15:33:55 -0400:

>> Date: Sat, 25 Oct 2003 01:39:04 +1000
>> From: leo <email@hidden>
>> Subject: newbie question: real with fraction to int
>
>> set i to 9.5 as integer
>
> set i to 9.5 div 1 --> 9, integer division
>
> (* ROUNDING HACK:
> *)
> set i to {9.5} as integer --> 10

I see from the release notes for AppleScript 1.9.2 (OS 10.3 or later)
that "Real numbers can now be coerced to integers even if they have a
non-zero fractional part. Rounding is used to do the coercion."

<http://www.apple.com/applescript/releasenotes/192OSX.html>

This release has lots of other useful and interesting features - some of
which could render a few cherished scripting techniques redundant. ;-)

NG
_______________________________________________
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: newbie question: real with fraction to int
      • From: Paul Berkowitz <email@hidden>
    • Re: newbie question: real with fraction to int
      • From: Paul Berkowitz <email@hidden>
    • Re: newbie question: real with fraction to int
      • From: Michelle Steiner <email@hidden>
  • Prev by Date: Re: Get IP
  • Next by Date: Re: newbie question: real with fraction to int
  • Previous by thread: Re: newbie question: real with fraction to int
  • Next by thread: Re: newbie question: real with fraction to int
  • Index(es):
    • Date
    • Thread