[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [numbers/general] unlikely argument type warning

On Thu, 13 Dec 2018 11:39:05 -0800, Eric Barnhill wrote:
For the line:


What is it testing?
Conceptually, I'd expect "assertTrue" (zero as a fraction
is equal to zero as a double).

Eclipse is producing a warning:

"Unlikely argument type for equals(): Double seems to be unrelated to

Does anyone have a suggestion for how to handle this warning, thank you.

Perhaps Eclipse indicates that the test is useless (since
"Double" is not a subclass of "Fraction").

And perhaps "Fraction" should overload "equals":

public boolean equals(double x, int ulp) {
   return Precision.equals(doubleValue(), x, ulp);
public boolean equals(Number x, int ulp) {
   return equals(x.doubleValue, ulp);
public boolean equals(double x) {
   return equals(doubleValue(), x, 1);



To unsubscribe, e-mail: dev-unsubscribe@xxxxxxxxxxxxxxxxxx
For additional commands, e-mail: dev-help@xxxxxxxxxxxxxxxxxx