Trusted answers to developer questions
Trusted Answers to Developer Questions

Related Tags

basic
floor
division

Floor division

Educative Answers Team

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Floor division is a normal division operation except that it returns the largest possible integer. This integer is either less than or equal to the normal division result.

Floor function is mathematically denoted by this ⌊ ⌋ symbol.

Let’s understand this concept through the slides below:

1 of 4

Code

Several programming languages have a specific built-in function or operator for calculating floor division.

  • floor() method is used in C++
  • Math.floor() is used in Java
  • // operator is used in Python
#include <iostream>
//include math library
#include <cmath>
using namespace std;
int main() {
// floor() method is used.
cout << "Floor of 36/5 is " << floor(36/5) << endl;
return 0;
}

RELATED TAGS

basic
floor
division
Copyright ©2022 Educative, Inc. All rights reserved

Grokking Modern System Design Interview for Engineers & Managers

Ace your System Design Interview and take your career to the next level. Learn to handle the design of applications like Netflix, Quora, Facebook, Uber, and many more in a 45-min interview. Learn the RESHADED framework for architecting web-scale applications by determining requirements, constraints, and assumptions before diving into a step-by-step design process.

Keep Exploring