推 IAMPF: 10 * 0.000001 - 1 * 0.00001 < sys.float_info.epsilon 07/26 16:34
推 TuCH: round(10*0.000001,10)==round(1*0.00001,10) 07/26 16:36
→ TuCH: Decimal('10')*Decimal('0.000001)==Decimal('1')*Decimal(' 07/26 16:37
推 TitanEric: 推一樓方法 不要直接用等於 這是IEEE 754 07/26 17:53
推 f496328mm: 一樓的方法好'數學' 07/26 17:54
推 sherees: 用一樓的方法記得加絕對值喔 07/27 11:26
→ sherees: 因為sys.float_info.epsilon>0 所以負數會是True 07/27 11:27
→ sherees: 舉個例子1-2>epsilon>>True 但1!=2 這個結果明顯是誤判 07/27 11:32
→ sherees: < 07/27 11:33
→ sherees: 更正 07/27 11:34