Given two floating-point numbers, find the remainder.
Input: a = 36.5, b = 5.0
Input: a = 9.7, b = 2.3
A simple solution is to do repeated subtraction.
We can use the inbuilt fmod function to find the modulus of two floating-point numbers.
Don’t stop now and take your learning to the next level. Learn all the important concepts of Data Structures and Algorithms with the help of the most trusted course: DSA Self Paced. Become industry ready at a student-friendly price.
- Difference between float and double in C/C++
- C/C++ program to find the size of int, float, double and char
- Modulus on Negative Numbers
- Modulus function in C++ STL
- Finding 'k' such that its modulus with each array element is same
- Maximize the sum of modulus with every Array element
- Modulus of all pairwise consecutive elements in an Array
- Comparison of a float with a value in C
- <cfloat> float.h in C/C++ with Examples
- Function Overloading and float in C++
- Double not (!!) operator in PHP
- gcvt() | Convert float value to string in C
- Assigning an integer to float and comparison in C/C++
- Convert Double to Integer in Java
- Convert String to Double in Java
- Double Brace Initialization in Java
- Double forking to prevent Zombie process
- Solutions to prevent Double-Spending of Bitcoins
- What is the difference between single quoted and double quoted declaration of char array?
- Fill the missing numbers in the array of N natural numbers such that arr[i] not equal to i
If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to firstname.lastname@example.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.
Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.