libyang icon indicating copy to clipboard operation
libyang copied to clipboard

Whether the precision of Floating-point arithmetic numbers may cause inaccuracy comparsion.

Open jiayinhaoran opened this issue 2 years ago • 1 comments

image

When I compile code with -Wfloat-equal and find such warning: warning: comparing floating point with == or != is unsafe [-Wfloat-equal]

'num' is 'long double' type. Whether the precision of Floating-point arithmetic numbers may cause inaccuracy comparsion. @michalvasko

jiayinhaoran avatar Jun 09 '23 04:06 jiayinhaoran

Whether the precision of Floating-point arithmetic numbers may cause inaccuracy comparsion.

I suppose it can, do you have a better idea that can be used for any XPath expressions?

michalvasko avatar Jun 09 '23 08:06 michalvasko