Floor & Ceiling (no walls yet)
Floor & Ceiling (no walls yet)
- Subject: Floor & Ceiling (no walls yet)
- From: ehsan saffari <email@hidden>
- Date: Mon, 02 Feb 2004 17:10:12 -0600
Hi
Here is my attempt at defining Floor & Ceiling functions in AppleScript:
Anything wrong there? Can they be improved?
----Get Ceiling of a number----
on getceil(x)
if x > 0 then
set y to (x div 1) + 1
else if x < 0 then
set y to (x div 1)
end if
return y
end getceil
----
----Get Floor of a number----
on getfloor(x)
if x > 0 then
set y to x div 1
else if x < 0 then
set y to -(1 - x) div 1
end if
return y
end getfloor
----
Thanks for any comments
cheers
ehsan
_______________________________________________
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.