cpp/numeric/math/fmod: Różnice pomiędzy wersjami
Z cppreference.com
m (1 wersja: Import from Dokuwiki) |
m (r2.7.3) (Robot dodał en, fr, ja, pt, zh) |
||
Linia 22: | Linia 22: | ||
Tematy pokrewne: [[cpp/numeric/math/ceil | ceil]], [[cpp/numeric/math/fabs | fabs]], [[cpp/numeric/math/floor | floor]] | Tematy pokrewne: [[cpp/numeric/math/ceil | ceil]], [[cpp/numeric/math/fabs | fabs]], [[cpp/numeric/math/floor | floor]] | ||
+ | |||
+ | |||
+ | |||
+ | |||
+ | |||
+ |
Wersja z 16:46, 4 maj 2012
Składnia:
#include <cmath> double fmod(double x, double y);
Funkcja fmod() zwraca resztę z dzielenia x przez y. Na przykład:
x = 3.2; y = 1.5; z = fmod(x, y);
spowoduje przypisanie z wartości 0.2.
C++ dostarcza przeciążone wersje funkcji:
#include <cmath> float fmod(float x, float y); //to samo co fmodf() w C99 long double fmod(long double x, long double y); //to samo co fmodl() w C99