Beefy Boxes and Bandwidth Generously Provided by pair Networks
The stupid question is the question not asked
 
PerlMonks  

Re: Re: Re: 0**0

by scain (Curate)
on Jan 16, 2003 at 17:54 UTC ( #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
Node Status?
node history
Node Type: note [id://227432]
help
Chatterbox?
[ambrus]: No, you're not doing anything wrong. It's just that our automatic spam filters confuse you with the spammers who post advertisments for online shops of counterfeit branded clothing.
[ambrus]: Or unless you left the title field empty or entered a very short title for the node, but then you'd get a message saying that.
[ambrus]: I hope Corion or some other admin is here and can check the logs to see what the problem is.
[mz2255]: I wish I had an online shop but sadly no. The title field definitly wasn't short, had a perl module in the title with 5-6 additional words.
[ambrus]: you can also try to just post again in case it was some intermittent error

How do I use this? | Other CB clients
Other Users?
Others making s'mores by the fire in the courtyard of the Monastery: (12)
As of 2017-10-19 15:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    My fridge is mostly full of:

















    Results (255 votes). Check out past polls.

    Notices?