58 lines
2.1 KiB
Plaintext
58 lines
2.1 KiB
Plaintext
![]() |
=== Duplicate: RSPEC-884
|
||
|
|
||
|
=== On 2014-04-22T21:37:12Z Evgeny Mandrikov Wrote:
|
||
|
\[~freddy.mallet] [~ann.campbell.2] duplicates RSPEC-884 ?
|
||
|
|
||
|
=== On 2014-04-23T15:30:08Z Ann Campbell Wrote:
|
||
|
Closed the other since this is more fully specified
|
||
|
|
||
|
=== On 2014-04-23T15:54:51Z Evgeny Mandrikov Wrote:
|
||
|
\[~ann.campbell.2] For rules coming from MISRA I prefer titles from MISRA instead of hand-crafted ones ;) Same probably for description - I expect it to be good in MISRA.
|
||
|
|
||
|
=== On 2014-09-17T10:01:01Z Freddy Mallet Wrote:
|
||
|
@Ann, for me the compliant solution is incorrect because if the developer really wants to check for equality, using the ">=" operator is obviously not an option.
|
||
|
|
||
|
|
||
|
See MISRA description:
|
||
|
|
||
|
____
|
||
|
The recommended method for achieving deterministic floating-point comparisons is to write a library
|
||
|
|
||
|
|
||
|
that implements the comparison operations. The library should take into account the floating-point
|
||
|
|
||
|
|
||
|
granularity (FLT_EPSILON) and the magnitude of the numbers being compared. See also Rule 13.4 and
|
||
|
|
||
|
|
||
|
Rule 20.3.
|
||
|
|
||
|
____
|
||
|
|
||
|
=== On 2014-09-30T08:50:00Z Evgeny Mandrikov Wrote:
|
||
|
\[~ann.campbell.2] I can't finish implementation of this rule with unfinished description - see comment from [~freddy.mallet]
|
||
|
|
||
|
=== On 2014-09-30T12:00:34Z Ann Campbell Wrote:
|
||
|
\[~evgeny.mandrikov] see the C-Family sub-task
|
||
|
|
||
|
=== On 2014-09-30T12:14:12Z Evgeny Mandrikov Wrote:
|
||
|
\[~ann.campbell.2] ok, thx
|
||
|
|
||
|
=== On 2014-10-03T08:16:25Z Nicolas Peru Wrote:
|
||
|
I disagree with cases like :
|
||
|
|
||
|
----
|
||
|
if(myNumber <= 3.146 && myNumber >= 3.146)
|
||
|
if (myNumber < 4 || myNumber > 4)
|
||
|
----
|
||
|
For me this is crappy code no matter if you are using floating point or not. I truly believe this case should not pollute this rule and be a rule on its own (applied to every numeric type) with the suggestion to refactor it using ``++=++`` or ``++!=++``
|
||
|
|
||
|
|
||
|
|
||
|
|
||
|
=== On 2014-10-03T14:02:01Z Ann Campbell Wrote:
|
||
|
\[~nicolas.peru] what if the user activates this rule but not the other one?
|
||
|
|
||
|
Also, the "crappy" example is drawn almost exactly from MISRA. We can debate whether or not it belongs in the Java implementation (although it is an equality test), but it needs to remain in the main rule.
|
||
|
|