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 ( #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?
[GrandFather]: discovering that one of the sensors for the device lies about the gain range it is using!
[GrandFather]: However, by the end of the day I had discovered its deceptions and now have it working correctly, so yes, all's well that ends well. :-D
[Corion]: GrandFather: Ah, (hardware) APIs - I have a similar situation with Chrome and its API... It is fairly underdocumented and I guess I have to hunt...
[Corion]: ... down supposedly working code to find out what I'm supposed to do
[GrandFather]: I haven't any "working code" to inspect! I have to find ways to generate reference signals then check the numbers I get at the far end match.
[GrandFather]: That's ok when the signal is a voltage, but there are three axis accelerometers, gyroscopes and magnetometers in these things! A little invention is needed at times!
[Corion]: GrandFather: Yeah, in that aspect, hardware is far more a black box than software
[GrandFather]: Oh, and the manufacturer tells lies too! I'm sure they don't mean to, but I know for sure some of the stuff they say is just wrong. It's possible they don't understand what we are asking, but that's not a good look either
[Corion]: GrandFather: Ah, unit testing hardware is fun, especially when the hardware is uncalibrated ...

How do I use this? | Other CB clients
Other Users?
Others pondering the Monastery: (5)
As of 2017-08-24 07:08 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Who is your favorite scientist and why?



























    Results (365 votes). Check out past polls.

    Notices?