Code Search for Developers
 
 
  

cabs.cpp from Oscill8 at Krugle


Show cabs.cpp syntax highlighted

#ifdef KR_headers
extern double sqrt();
double f__cabs(real, imag) double real, imag;
#else
#undef abs
#include "math.h"
double f__cabs(double real, double imag)
#endif
{
double temp;

if(real < 0)
	real = -real;
if(imag < 0)
	imag = -imag;
if(imag > real){
	temp = real;
	real = imag;
	imag = temp;
}
if((real+imag) == real)
	return(real);

temp = imag/real;
temp = real*sqrt(1.0 + temp*temp);  /*overflow!!*/
return(temp);
}




See more files for this project here

Oscill8

Oscill8 is a suite of tools for analyzing dynamical systems which concentrates on understanding how the dynamical behavior depends on the parameters using bifurcation theory and reaction network theory.

Project homepage: http://sourceforge.net/projects/oscill8
Programming language(s): C,C#,C++
License: other

  cabs.cpp
  d_imag.cpp
  d_lg10.cpp
  d_sign.cpp
  i_dnnt.cpp
  i_nint.cpp
  pow_dd.cpp
  pow_di.cpp
  pow_ii.cpp
  r_lg10.cpp
  z_abs.cpp
  z_exp.cpp
  z_log.cpp