Here you can find the source of booleanToDouble(boolean b)
public static double booleanToDouble(boolean b)
//package com.java2s; //License from project: LGPL public class Main { public static double booleanToDouble(boolean b) { return b ? 1. : 0.; }//from w w w.j av a 2s. c o m }