laziness, impatience, and hubris PerlMonks

### RE: RE: Adding 2 + 2

 on Sep 11, 2000 at 20:29 UTC ( #31915=note: print w/replies, xml ) Need Help??

```perl -wle 'print \$^W*2**\$^W*2'
That's not 2 + 2, thats 2 squared.
(Ok, I know... the answer is the same... but the route is different.)

Replies are listed 'Best First'.
(Ozymandias) RE(3): Adding 2 + 2
by Ozymandias (Hermit) on Sep 11, 2000 at 20:34 UTC
Well, speaking as a engineer by training, the program meets spec... where's the problem? <G>

If you wanted flexibility and easy upgrades, you should have made sure that was part of the original program spec.

Ozymandias pries tongue from cheek...

- email Ozymandias
Re: RE: RE: Adding 2 + 2
by a (Friar) on Feb 11, 2001 at 10:04 UTC
Uh, I thought 2 squared was just a shorthand for 2 + 2, er, or inherently linked or something. Sure, it a ... what's that word, pathological? case but ...

a

So nearly...

22 is a shorthand for 2x2, which is a special case, since the exponent equals the mantissa. It's only equal to 2+2 by coincidence, though, or rather, due to the fact that 2 enumerates the number of arguments taken by binary (!=base 2) addition. There's nothing terribly pathological about any of this. The result (which I understand Larry wants allowed by Perl 6) that 00=1 is really pathological.

And I may be just a novice, but how about:
sub addtwoandtwo { 2+2 } ?

Tiefling (utter novice)

Thanks for the downvotes! Feel like telling me what's wrong?

Create A New User
Node Status?
node history
Node Type: note [id://31915]
help
Chatterbox?
 [LanX]: Doorn [erix]: yes, I got it :) It's close to where I live (Utrecht) [LanX]: Dutch royals usually spent their exiles on Berlin [erix]: well, dutch royals are germans, really [choroba]: Utrecht? Is that where we made the trip, LanX? [erix]: we should really dupm the lot, but I got no say in the matter :) [LanX]: yeah its a religious mafia , the only two big calvinist houses are dutch and prussian. .. [LanX]: choroba yes [erix]: Utrecht has a beautiful old center, and less mass-tourism than Amsterdam [erix]: next time, drop by :)

How do I use this? | Other CB clients
Other Users?
Others lurking in the Monastery: (11)
As of 2017-12-15 16:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
Voting Booth?
What programming language do you hate the most?

Results (439 votes). Check out past polls.

Notices?