Skip to content

Instantly share code, notes, and snippets.

@bjartwolf
Created April 12, 2014 13:14
Show Gist options
  • Save bjartwolf/10535228 to your computer and use it in GitHub Desktop.
Save bjartwolf/10535228 to your computer and use it in GitHub Desktop.
[<Measure>] type m
[<Measure>] type s
[<Measure>] type kg
[<Measure>] type N = kg m / s / s
let a = 9.81<m/s/s>
let mass = 10.0<kg>
let f = a*mass
let pow3 (x:float<'u>):float<'u^3> =
let power = pown (float x) 3
((box power) :?> float<'u^3>)
let f2 = pow3 f
let f3 = f2+f
f2.Dump()
@bjartwolf
Copy link
Author

The error is obviously right, it's the implementation of pow3 that sucks...

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