Skip to content

Commit

Permalink
fix floating point errors at edge cases
Browse files Browse the repository at this point in the history
  • Loading branch information
bvenn committed Feb 21, 2023
1 parent 0344f07 commit 32fa0c2
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/FSharp.Stats/Distributions/Empirical.fs
Original file line number Diff line number Diff line change
Expand Up @@ -158,7 +158,7 @@ module Empirical =
let halfBw = bandwidth / 2.0
let tmp =
data
|> Seq.groupBy (fun x -> floor (x / bandwidth))
|> Seq.groupBy (fun x -> (decimal x / decBandwidth) |> float |> floor)
|> Seq.map (fun (k,values) ->
let count = (Seq.length(values)) |> float
if k < 0. then
Expand Down

0 comments on commit 32fa0c2

Please sign in to comment.