Possible to use calcHist with a float as bin

have a look at the tutorial again,
your range should be {0,1} (it’s for all the bins), and the histSize (number of bins) should be 2