Jump to content

python math


hisoka

Recommended Posts

floor division is a mathematical division that rounds down to nearest integer.

 

 

89 / 45 gives 1.9777777777777779

 

meanwhile 89//45 gives 1 why not 2 ? 2 is the nearest integer to 1,97777777777777777779 and not 1 so normally it should give 2 not 1

 

98.45//56.54 gives 1.0 why not 1 ? why 1.0 I consider it as a mistake from the people who invented python as it must give 1 and not 1.0

 

for example 90/45 = 2.0 meanwhile 90//45 gives 2

 

 

 

 

 

 

Link to comment
Share on other sites

1,97 is between 1 and 2 and the nearest number to 1,97 is 2 so 1,97 when rounded to the nearest , it becomes 2 and not 1 . and 1,97 is rounded up not down because the last digit is greater than 5

 

What do you say about that?

Edited by hisoka
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...