[#1026] Is this a bug? — Dave Thomas <Dave@...>

18 messages 2000/01/03

[#1084] Infinite loop — Dave Thomas <Dave@...>

17 messages 2000/01/11

[#1104] The value of while... — Dave Thomas <Dave@...>

24 messages 2000/01/11

[ruby-talk:01172] Re: Possible bug in ruby-man-1.4

From: Huayin Wang <wang@...>
Date: 2000-01-24 20:54:14 UTC
List: ruby-talk #1172
> |Well, I guess it comes down to what you mean by an integer
> |literal. Right now, we have a somewhat confusing situation:
> |
> |  a = -2
> |
> |assigns '-2' directly to a
> |
> |  a = -2.+(3)
> |
> |generates  5:Fixnum, then applies -@, resulting in -5.
> 
> Agree with it.  According to the principle of less surprise, I'll
> change the parser to understand UMINUS followed by digits as number.
> Acutually it worked so before.  I removed that for simplicity, but
> maybe it was too simple.
>
>							matz.

does this have anything to do with the following?

irb(main):001:0> -2 ** 2
-4
irb(main):002:0> 




In This Thread

Prev Next