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.
Attention reader! Don’t stop learning now. Get hold of all the important DSA concepts with the DSA Self Paced Course at a student-friendly price and become industry ready.
- Maximize modulus by replacing adjacent pairs with their modulus for any permutation of given Array
- Modulus on Negative Numbers
- Difference between float and double in C/C++
- C/C++ program to find the size of int, float, double and char
- Finding 'k' such that its modulus with each array element is same
- Modulus of all pairwise consecutive elements in an Array
- Modulus function in C++ STL
- Maximize the sum of modulus with every Array element
- Comparison of a float with a value in C
- Function Overloading and float in C++
- Assigning an integer to float and comparison in C/C++
- gcvt() | Convert float value to string in C
- Formatting float column of Dataframe in Pandas
- <cfloat> float.h in C/C++ with Examples
- What is the difference between single quoted and double quoted declaration of char array?
- Double Brace Initialization in Java
- Double Pointer (Pointer to Pointer) in C
- Double forking to prevent Zombie process
- C program to print a string without any quote (singe or double) in the program
- Convert String to Double in Java
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.