Skip to content

Instantly share code, notes, and snippets.

@bjartwolf
Created April 21, 2014 18:49
Show Gist options
  • Save bjartwolf/11152433 to your computer and use it in GitHub Desktop.
Save bjartwolf/11152433 to your computer and use it in GitHub Desktop.
2.5.3.fs
let RoundM3 (cubic:decimal<m^3>): decimal<m^3> = Math.Round(cubic * 1m<m^-3>,10)*1m<m^3>
let VolumeAIsBEqualssquare((a:decimal<m>), (h:decimal<m>)) =
RoundM3 (V h a a) = RoundM3( a * a * h )
let twoDecimals = Arb.generate<decimal<m>> |> Gen.suchThat ((<) 0m<m>) |> Gen.suchThat ((>) 1000000m<m>) |> Gen.two |> Arb.fromGen
Check.Quick (Prop.forAll twoDecimals VolumeAIsBEqualssquare)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment