Skip to content

Instantly share code, notes, and snippets.

@erica
Last active April 6, 2016 18:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erica/786ab9703f699db1301be65510e7da03 to your computer and use it in GitHub Desktop.
Save erica/786ab9703f699db1301be65510e7da03 to your computer and use it in GitHub Desktop.
(0..<199).striding(by: -2): 0..<199 == 0...198 Even
(1..<199).striding(by: -2): 1..<199 == 1...198 Even
(0..<198).striding(by: -2): 1..<198 == 0...197 Odd
(1..<198).striding(by: -2): 1..<198 == 1...197 Odd

(1.0 ..< limit).striding(by: -stride) <-- is undefined for floating point strides as there cannot be a starting value.

similarly striding by 0 or 0.0 should be undefined a precondition failure

@stephentyrone
Copy link

"undefined" or preconditionFailure?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment