-3

I have part of the code:

public void CollectorOrPocrushka(double output) {
    if (output <= 0.4999999999999999999999)
        System.out.println("покришка");
    if (output > 0.5 && output <= 1.0)
        System.out.println("колектор");
}

Can I write float number 0.4999999999999999999999 shorter?

Something like that: 0.49F 0.49e^10

1 Answers1

3

If your question is about to simplify the first if condition and your goal is to check if the output is less than or equal 0.4999999999999999999999, you can easily write

if(output < 0.5) 
    System.out.println("покришка");

AmrDeveloper
  • 3,826
  • 1
  • 21
  • 30