Path: utzoo!utgpu!cunews!cognos!alanm From: alanm@cognos.UUCP (Alan Myrvold) Newsgroups: comp.lang.perl Subject: More ** weirdness Message-ID: <9077@cognos.UUCP> Date: 23 Nov 90 15:57:44 GMT References: <109161@convex.convex.com> Reply-To: alanm@cognos.UUCP (Alan Myrvold) Organization: Cognos Inc., Ottawa, Canada Lines: 23 In article <109161@convex.convex.com> tchrist@convex.com (Tom Christiansen) writes: >On a Sun, these expressions return these values: > > (-1) ** 1 1 > (-1) ** 2 -1 > (-1) ** 3 1 > (-1) ** 4 -1 well for me (on a Sun), it is exactly opposite (as I would expect). What surprises me is the need for parentheses when using '**' with 'print'. On both PL 36 and 41, print ((-1) ** 2); produces 1 print (-1) ** 2; produces -1 print (2 ** 3); produces 8 print 2 ** 3; produces 8 --- Alan Myrvold 3755 Riverside Dr. uunet!mitel!cunews!cognos!alanm Cognos Incorporated P.O. Box 9707 alanm@cognos.uucp (613) 738-1440 x5530 Ottawa, Ontario CANADA K1G 3Z4