mbaz/Gaston.jl — pull request #13 by carlobaldassi (2013-06-12 23:38:57+00:00)
Title: Fix histogram computation

I found a case where `histogram` was plotting wrong results, so I started fixing it, and while testing I ended up with a number of things which this pull request will hopefully solve:

* the previous implementation had problems due to cases where `ms+eps()==ms`
* handle the case in which all values are equal
* handle the case of a single bin
* avoid some more corner cases (e.g. if `(ms:delta:Ms)[end] != Ms`)
* return the exact number of bins requested (i.e. remove the empty one at the end)

As an example of the first issue (which is the most relevant IMO):

```
julia> 100 + eps() == 100
true
```

which meant that the minimum values were left out from the plot.
Initially, I considered using `nextfloat` and co., but that was turning out to be a messier solution that what I wrote in the end, I believe.

As an example of the other mentioned corner case:

```
julia> (1:1/49:27)[end]
26.999999999999996
```

So e.g. if you requested `1274` bins for some data between `1` and `27` you would miss the `27`s if not careful.

I added comments to the code, as was the case for the original code, explaining the reason behind all the choices. I hope I didn't miss any corner case.