Skip to content

Instantly share code, notes, and snippets.

@diegofrata
Created February 1, 2013 21:00
Show Gist options
  • Save diegofrata/4694113 to your computer and use it in GitHub Desktop.
Save diegofrata/4694113 to your computer and use it in GitHub Desktop.
F# DivRem Operator
namespace System.Numerics
[<AutoOpen>]
module DivRem =
type DivRem = DivRem with
static member (/%) (x : int32, DivRem) = fun y -> System.Math.DivRem(x, y)
static member (/%) (x : int64, DivRem) = fun y -> System.Math.DivRem(x, y)
static member (/%) (x : bigint, DivRem) = fun y -> BigInteger.DivRem(x, y)
let inline (/%) x y = (x /% DivRem) y
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment