Bottom Page

Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
 Unexpected round behavior
#1
Hi, I was using IDLE and trying to do: round(9/2) -- surprised that it says 4.. round(11/2) and round(7/2) all appear correct. How can we explain this behavior? thanks..
Quote
#2
See here: https://docs.python.org/2/tutorial/float...-fp-issues
Quote

Top Page

Possibly Related Threads...
Thread Author Replies Views Last Post
  inconsistent map() behavior mcmxl22 2 399 May-23-2020, 10:17 PM
Last Post: mcmxl22
  Odd Unit Test Behavior ichabod801 3 317 Jan-02-2020, 03:34 PM
Last Post: ichabod801
  Cant get my head round the algorithm hshivaraj 1 437 Apr-09-2019, 10:38 PM
Last Post: Yoriz
  Unexpected ininite loop behavior RedSkeleton007 4 700 Jan-27-2019, 05:32 PM
Last Post: aakashjha001
  Unexpected behavior appending to a List of Dictionaries Nomad 2 1,021 Apr-03-2018, 04:22 AM
Last Post: Nomad
  Add parameter to math.floor() to round to specific decimal point gabrield 2 931 Mar-09-2018, 08:43 PM
Last Post: wavic
  Round a number up to certain significant figures brocq_18 4 3,543 Apr-06-2017, 06:49 PM
Last Post: alicarlos13

Forum Jump:


Users browsing this thread: 1 Guest(s)