parentheses confusion w/1.7.2 
Author Message
 parentheses confusion w/1.7.2

So 1.7.2 allows,

 p (-2)*(-2)

yielding '4'.  (Note: 1.6.7 doesn't allow this construct.)

However, for a mathematically equivalent expression,

 p (-2)**2

I get '-4'!?  But if I prod further and wrapping things in parentheses,

 p ((-2)**2)

I once again achieve the expected value of '4'.

Why does an extra set of parenthesis change the sign?

Is this some sort of parsing thing?

 % ruby -v
 ruby 1.7.2 (2002-05-23) [i686-linux]

Surprised and confused,
--
Bil



Tue, 09 Nov 2004 23:01:40 GMT  
 parentheses confusion w/1.7.2
Hi,

In message "parentheses confusion w/1.7.2"

|However, for a mathematically equivalent expression,
|
| p (-2)**2

It's a bug.

|Surprised and confused,

Sorry.

                                                        matz.



Wed, 10 Nov 2004 01:53:21 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. less parentheses --> fewer parentheses

2. less parentheses --> fewer parentheses

3. Dangling Closing Parentheses vs. Stacked Closing Parentheses

4. PUBKAR - parentheses not always first

5. Howto get round parenthesis literally

6. Using parentheses in an SQL query

7. Use of parentheses in an SQLSelect query

8. Whitespace, parentheses, methods, and arrays (was: Multiple file types in open dialog)

9. Awk and the open Parenthesis

10. ABC Code : Return without parenthesis

11. Parenthesis in formula node

12. Parenthesis Balancing

 

 
Powered by phpBB® Forum Software