remainder(x, y) ফাংশন <cmath>-এ সংজ্ঞায়িত। এটি x/y-এর কোশেন্টকে নিকটতম সম সংখ্যার দিকে রাউন্ড করে রিমেইন্ডার রিটার্ন করে। fmod-এর থেকে ভিন্ন (সে ট্রুন্ডেট করে)।
সিনট্যাক্স
double remainder(double x, double y); উদাহরণ
#include <cmath>
#include <iostream>
using namespace std;
int main() {
cout << remainder(51, 5) << endl; // 1 (51 - 10*5 = 1, 10.2→10)
cout << remainder(51, 0) << endl; // গারবেজ/ইউবি (ডোমেইন এরর)
}
আউটপুট
Value of Remainder is 51/5 is: 1 Value of Remainder is 51/0 is: -2147483648 // garbage