restwertrechnung
-
hi,
kann mir einer den code von fmod (restwertrechnung mit fielßkommazahlen) geben ?
danke ...
-
The fmod() function computes the remainder of dividing x by y. The
return value is x - n * y, where n is the quotient of x / y, rounded
towards zero to an integer.Aus fmod(3).
-
double fmod(double x, double y) { double i=0.0, f=0.0; if (y == 0.0) { errno = EDOM; return 0.0; } i = floor(x/y); f = x - i*y; if ((x < 0.0) != (y < 0.0)) f = f-y; return f; }
-
und wie ist der code von floor ???
wie kann man fließkomma zahlen runden???danke aber schonmal ... hat mir schon ein stück weiter geholfen ...
-
so kannste zahlen runden
#include <math.h>
double round(double);
double trunc(double);
double rint(double);