Bug 1223

Summary: Improve floating point handling
Product: libsigrok Reporter: Uwe Hermann <uwe>
Component: OtherAssignee: Nobody <nobody>
Status: CONFIRMED ---    
Severity: normal    
Priority: Normal    
Version: unreleased development snapshot   
Target Milestone: ---   
Hardware: All   
OS: All   
Bug Depends on:    
Bug Blocks: 1225    

Description Uwe Hermann 2018-06-06 22:46:45 CEST
This is a generic bug for improving various code chunks in libsigrok wrt floating point handling (e.g. comparison).

One specific issue in practice was #1149 (in PulseView), but recently another problem occurred with hantek-4032l voltage thresholds (same reason as #1149, a different fix will be needed).

Similar issues also exist in libsigrok.

Relevant URLs:
https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/
https://www.boost.org/doc/libs/1_64_0/libs/math/doc/html/math_toolkit/float_comparison.html
Comment 1 Uwe Hermann 2018-06-06 22:52:55 CEST
The compiler option -Wfloat-equal can be used to find all (or at least most?) issues related to direct floating point comparison via "==". Other FP-related issues in addition to those might exist in the code-base, though.