Beefy Boxes and Bandwidth Generously Provided by pair Networks
Welcome to the Monastery
 
PerlMonks  

Re: 0**0

by JaWi (Hermit)
on Jan 16, 2003 at 16:03 UTC ( #227400=note: print w/replies, xml ) Need Help??


in reply to 0**0

Hi Juerd,

0**0 should be somewhere between 0 and undefined (source: here). So, actually, it should return undef, since that's what most (if not all) math-books say.

Hope it helps,

Greets,

-- JaWi

"A chicken is an egg's way of producing more eggs."

Replies are listed 'Best First'.
Re: Re: 0**0
by scain (Curate) on Jan 16, 2003 at 16:16 UTC
    I disagree. Yes, there are situations where 0^0 should be undefined, but there are also several cases where it should be 1. Given that, I don't want my numerical methods package to be crashing all the time because Perl thinks it should be undef.

    The fact is, the coder should know which case he is interested in (1 or undef as the answer); I think it is better from a coding perspective to check for the undef case, and just allow the 0^0 == 1 case without special checking.

    Now, who the heck is writing numerical methods packages in Perl--FORTRAN is the way to go :-)

    Scott
    Project coordinator of the Generic Model Organism Database Project

      Ok, I see your point. However, if you would define 0**0 as being 1, you're making an exception "just because it is so darn handy while programming". In that case, you would need to handle other exceptions like, for example, sqrt(-1) as well, since this would be handy as well...

      -- JaWi

      "A chicken is an egg's way of producing more eggs."

        No, not because it is 'so darn handy', because sometimes it is right. See the link I posted under my first response; I trust mine more than yours since it is derived from sci.math FAQs.

        Scott
        Project coordinator of the Generic Model Organism Database Project

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://227400]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2022-08-18 20:33 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found

    Notices?