[issue47160] round function is not working as expected

2022-03-30 Thread Karthikeyan Singaravelan

Karthikeyan Singaravelan  added the comment:

This is documented

https://docs.python.org/3/library/functions.html#round

> The behavior of round() for floats can be surprising: for example, 
> round(2.675, 2) gives 2.67 instead of the expected 2.68. This is not a bug: 
> it’s a result of the fact that most decimal fractions can’t be represented 
> exactly as a float. See Floating Point Arithmetic: Issues and Limitations for 
> more information.

--
nosy: +xtreak
resolution:  -> not a bug
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue47160] round function is not working as expected

2022-03-30 Thread ATUL VISHAL


New submission from ATUL VISHAL :

round function is not working as expected .
my number is x= 0.967565*185000= 178999.525
round(x,2)
answer is coming as 178999.52
expected value is 178999.53

--
components: Library (Lib)
files: compiled_result.jpg
messages: 416333
nosy: vishalatul09
priority: normal
severity: normal
status: open
title: round function is not working as expected
type: behavior
versions: Python 3.7
Added file: https://bugs.python.org/file50707/compiled_result.jpg

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com