Float comparison mismatch

后端 未结 2 1328
借酒劲吻你
借酒劲吻你 2021-01-24 23:42

I have an extremely weird error that I cannot figure out.

float distance = Utils.distance(this.spriteStartX, this.spriteStartY, this.getX(), this.getY());

Utils         


        
相关标签:
2条回答
  • 2021-01-25 00:05

    Remove the semicolon after the if statement.

    if (distance >= this.spriteDistance)
    {
        Utils.log(distance+" is greater than "+this.spriteDistance);
    }
    
    0 讨论(0)
  • 2021-01-25 00:22

    Remove the semi-colon at the end of the if statement.

    0 讨论(0)
提交回复
热议问题