swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

I must be doing something stupid, but what?!


From: Doug Donalson
Subject: I must be doing something stupid, but what?!
Date: Mon, 31 Jul 2000 15:27:43 -0700

Here are two calculations, all variables are doubles.  They give different
results.  I believe that they should give the same result.

#1
      temp3=sqrt(sqrDistance);
      temp4=crown+aMussel->crown;
      temp5=temp1+temp2;
      temp6=(temp3-temp4)/temp5;

#2

      time= ( (sqrt(sqrDistance))-(crown+aMussel->crown) )/(temp1+temp2);

I believe that temp6 and time should be the same, in my program they are
not.  Calculation #1 gives the correct answer which is around 6.3, #2 claims
the result is 16.6.

What am I not seeing?

Cheers,

   D4

*********************************************************************
* Dr. Doug Donalson             Office: (805) 893-2962
* Ecology, Evolution,           Home:   (805) 961-4447
* and Marine Biology            email address@hidden
* UC Santa Barbara
* Santa Barbara Ca. 93106
*********************************************************************
*
*   The most exciting phrase to hear in science, the one that
*   heralds new discoveries, is not "EUREKA" (I have found it) but
*   "That's funny ...?"
*
*       Isaac Asimov
*
*********************************************************************




                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.



reply via email to

[Prev in Thread] Current Thread [Next in Thread]