Re: Very strange dates - BUG
Re: Very strange dates - BUG
- Subject: Re: Very strange dates - BUG
- From: Matthew Smith <email@hidden>
- Date: Fri, 31 Jan 2003 09:49:07 +1100
on 31/01/2003 07:31, Thomas at email@hidden wrote:
>
That is clearly a bug, -2^2 should return -4 of course. This lead to
>
eratic behaviour when you use this kind of calcul.
>
>
Thomas
>
>
Doug McNutt wrote :
>
>
> Try: set r to -2^2
>
>
>
> The return is +4 because Applescript gives higher precedence to a unary
>
> minus than anything else. It's possible that an associated bug affects
>
> x +(-1).
I always thought unary minus had a higher precedence than other operators in
most languages. If I wrote that the way I would in mathematics, which I
can't do here, I would have negative two to the power of two, which equates
to four. I wouldn't have negative of the result of two to the power of two.
Of course the way to stop confusion is to use parentheses. Either (-2)^2 or
-2(2^2).
--
Matthew Smith
_______________________________________________
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.