Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
  • Loading branch information
gampleman committed Mar 13, 2024
2 parents 57b8847 + a67d268 commit 1d79449
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 21 deletions.
2 changes: 1 addition & 1 deletion elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
"elm/json": "1.0.0 <= v < 2.0.0",
"elm/svg": "1.0.1 <= v < 2.0.0",
"elm/time": "1.0.0 <= v < 2.0.0",
"elm-community/list-extra": "8.2.4 <= v < 9.0.0",
"elmcraft/core-extra": "1.0.0 <= v < 3.0.0",
"folkertdev/one-true-path-experiment": "5.0.0 <= v < 7.0.0",
"gampleman/elm-rosetree": "1.0.0 <= v < 2.0.0",
"ianmackenzie/elm-geometry": "3.6.0 <= v < 4.0.0",
Expand Down
3 changes: 2 additions & 1 deletion examples/elm.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
"elm/url": "1.0.0",
"elm-community/graph": "6.0.0",
"elm-community/intdict": "3.0.0",
"elm-community/list-extra": "8.7.0",
"elm-community/typed-svg": "7.0.0",
"elm-explorations/linear-algebra": "1.0.3",
"elm-explorations/webgl": "1.1.3",
"elmcraft/core-extra": "2.0.0",
"folkertdev/one-true-path-experiment": "6.0.0",
"gampleman/elm-examples-helper": "2.0.0",
"gampleman/elm-rosetree": "1.1.0",
Expand All @@ -43,6 +43,7 @@
"elm/file": "1.0.5",
"elm/parser": "1.1.0",
"elm/virtual-dom": "1.0.3",
"elm-community/list-extra": "8.7.0",
"folkertdev/elm-deque": "3.0.1",
"folkertdev/svg-path-lowlevel": "4.0.1",
"ianmackenzie/elm-1d-parameter": "1.0.1",
Expand Down
22 changes: 3 additions & 19 deletions src/Statistics.elm
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Methods for transforming list and for generating new lists.
-}

import Bitwise
import Float.Extra
import List.Extra


Expand All @@ -49,24 +49,8 @@ Differences from [List.range from the standard library](https://package.elm-lang
-}
range : Float -> Float -> Float -> List Float
range start stop step =
let
n =
(stop - start)
/ step
|> ceiling
-- get rid of NaN
|> Bitwise.or 0
|> max 0

helper i list =
if i >= 0 then
helper (i - 1) (start + step * toFloat i :: list)

else
list
in
helper (n - 1) []
range =
Float.Extra.range


{-| Returns a list of approximately n + 1 uniformly-spaced, nicely-rounded
Expand Down

0 comments on commit 1d79449

Please sign in to comment.