Re: newbie question: real with fraction to int
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.