Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Re: Re: 0**0

by scain (Curate)
on Jan 16, 2003 at 17:54 UTC ( [id://227432]=note: print w/replies, xml ) Need Help??


in reply to Re: Re: 0**0
in thread 0**0

Clearly, if you are doing some numerical analysis, and you know in your case that 0**0 = 1 is not the right way to go, you absolutely should be checking for zeroes and handling them appropriately.

Scott
Project coordinator of the Generic Model Organism Database Project

Replies are listed 'Best First'.
Re: Re: Re: Re: 0**0
by Juerd (Abbot) on Jan 16, 2003 at 18:27 UTC

    Clearly, if you are doing some numerical analysis, and you know in your case that 0**0 = 1 is not the right way to go, you absolutely should be checking for zeroes and handling them appropriately.

    I need it to be 1. The question is if Perl will always say 0**0 is 1, or if it does something different on other platforms. Because even mathematicians can't agree on what 00 should be, I wonder if Perl will always deal with it in the same way, or depending on system configuration.

    Juerd
    - http://juerd.nl/
    - spamcollector_perlmonks@juerd.nl (do not use).
    

      Yes, I was somewhat disturbed by what Abigail-II reported for Perl 4; one would hope for consistency. I assume you've looked in the Perl source code to see how it evaluates 0**0? I would guess that it uses the operating system's math tools. I guess you are going to have to check for zeroes anyway, and set the value as an exception to be safe. Ugly, but it should work.

      Scott
      Project coordinator of the Generic Model Organism Database Project

        I assume you've looked in the Perl source code to see how it evaluates 0**0?

        Not really. I don't know C and Perl's source looks like a sendmail configuration file to me. :))

        Juerd
        - http://juerd.nl/
        - spamcollector_perlmonks@juerd.nl (do not use).
        

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others romping around the Monastery: (2)
As of 2024-04-26 03:22 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found