galaxy->Impulse = sqrt(impulseX*impulseX + impulseY*impulseY + impulseZ*impulseZ);
galaxy->Moment = sqrt(momentX *momentX + momentY *momentY + momentZ *momentZ );
galaxy->kineticEnergy = kinetic;
- if ( !isfinite(potential) ) potential=0;
+ if ( !finite(potential) ) potential=0;
galaxy->potentialEnergy = -potential;
}
#define iszero(x) ( fpclassify(x) & FP_ZERO )
#define CHK_ERRORVAL( what, err, val, prevval ) \
-if ( isfinite(val) && isfinite(prevval) ) { \
+if ( finite(val) && finite(prevval) ) { \
err = fabs( (val)/(prevval) - 1.0 ); \
- if ( !isfinite(err) ) \
+ if ( !finite(err) ) \
err = galaxy->error; \
} else { \
fprintf(stderr, "%s is not finite: val:%G prevval:%G\n", what, (val), (prevval)); \
}
for(i=0;i<XGalaxy.nentry;i++)
- if ( XGalaxy.entry[i].mass==0.0 || !isfinite(XGalaxy.entry[i].mass) ) {
+ if ( XGalaxy.entry[i].mass==0.0 || !finite(XGalaxy.entry[i].mass) ) {
GtkWidget *dialog = gtk_message_dialog_new (GTK_WINDOW(XGalaxy.window),
GTK_DIALOG_DESTROY_WITH_PARENT,
GTK_MESSAGE_ERROR,