Skip to content

Instantly share code, notes, and snippets.

@soc
Created October 3, 2011 19:14
Show Gist options
  • Save soc/1259954 to your computer and use it in GitHub Desktop.
Save soc/1259954 to your computer and use it in GitHub Desktop.
package metascala.example
object UnitExample extends App {
import metascala.Units._
val length = 5.0 *~ (2.0 m)
val length2 = length + (2.0 m) *~ 5.0
val time = (5.0 s) *~ 5.0
val speed = length2 *~ 2.0 /~ time /~ 4.0
val mass = (5.0 kg) + (5.0 kg)
val cd = 1.0 /~ (0.2 cd)
println(length)
println(length2)
println(time)
println(speed)
println(mass)
println(cd)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment