Why BigDecimal does not print 0.5000 in java?

I want to print 0.5000 value in java therefor I try BigDecimal for this purpose but when i divide i get 0.5 with red color.
Can i print 0.5000 using BigDecimal if not then why and why does 0.5 print in red font?
My code is:

static void plusMinus(int[] arr) {
    Double n = 0.0, p = 0.0, z = 0.0;
    for(int i = 0; i < arr.length; i++) {
        if(arr[i] < 0) n++;
        else if(arr[i] > 0) p++;
        else z++;
    }
    n = BigDecimal.valueOf(n/arr.length).setScale(4,RoundingMode.HALF_UP).doubleValue();
    p = BigDecimal.valueOf(p/arr.length).setScale(4,RoundingMode.HALF_UP).doubleValue();
    z = BigDecimal.valueOf(z/arr.length).setScale(4,RoundingMode.HALF_UP).doubleValue();

    System.err.println(p);  // print:0.5    //(in red font)
    System.out.println(n);  // print:0.3333
    System.out.println(z);  // print:0.1667
}