Re: Taking into account negative numbers
Re: Taking into account negative numbers
- Subject: Re: Taking into account negative numbers
- From: Simon Forster <email@hidden>
- Date: Tue, 25 Jun 2002 12:16:10 +0100
On Tuesday, June 25, 2002, at 12:04 pm, Anthony Adachi wrote:
Does anybody know what's the best way to check to see whether a number
is
negative?
-- negative numbers should not make a difference to the result.
As a quickie:
set a to -5
set b to -1
if a < 0 then set a to 0 - a
if b < 0 then set b to 0 - b
if a < b then
set theResult to b - a
else if b < a then
set theResult to a - b
else
set theResult to 0
end if
And now I sit back to see how it should be done ;-)
Simon Forster
________________________________________________
LDML Ltd, 4/5 Hazlitt Mews, London, W14 0JZ, UK
<tel int="+44 70 9230 5244" uk="070 9230 5244">
<fax int="+44 70 9230 5247" uk="070 9230 5247">
<
mailto:email@hidden>
________________________________________________
_______________________________________________
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.