doug-101 / ConvertAll-py

a flexible unit converter
http://convertall.bellz.org
39 stars 15 forks source link

Converting 32F to 0C #5

Closed qlmackey closed 4 years ago

qlmackey commented 5 years ago

Found a fun bug

From Unit: F To Unit: C

if I enter 32 F I get 5.6843419E-14 C

image

but if I enter From Unit: C To Unit: F

entering 0C I get 32F

image

doug-101 commented 5 years ago

Not really a bug, just a consequence of computers calculating in binary without perfect precision.

You have to admit that 10^-14 is very, very close to zero.

Unfortunately, the application has no way of knowing what answers are legitimate small numbers and which should be rounded to a more appropriate answer.