std::fmod
cppreference.com
<cmath> 에 정의되어 있음. | ||
float fmod(float x, float y ); | (1) | |
double fmod(double x, double y ); | (2) | |
longdouble fmod(longdouble x, longdouble y ); | (3) | |
Promoted fmod( Arithmetic x, Arithmetic y ); | (4) | (since C++11) |
나누기 연산 x/y의 나머지를 계산 합니다. 즉 어떤 정수 n으로 x-ny를 계산한 결과로 결과의 크기는 y
의 크기보다 작습니다.
4) 만약 모든 인자가 정수 타입이면 double로 캐스팅 합니다. 인자 중에 longdouble이 있으면 반환 타입도 longdouble입니다. 그 외에는 double입니다.
[편집]Parameters
x, y | - | 부동 소수점 값 |
[편집]Return value
인자로 나눗셈을 수행한 나머지 값. 결과는 x
와 동일한 부호를 가집니다.
[편집]See also
(C++11) | the quotient and remainder of integer division (function) |
(C++11) | signed remainder of the division operation (function) |