-
Notifications
You must be signed in to change notification settings - Fork 91
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow more heterogenous types in numeric operations #1
Comments
See also #22: val a = unit(1.0)
val b = unit(1)
val c = a + b // c has type Rep[Double] |
Maybe we should just add explicit arithmetic for all primitive types instead of relying on |
julienrf
added a commit
to js-scala/virtualization-lms-core
that referenced
this issue
Oct 4, 2012
See also #36 |
Lewix
pushed a commit
to Lewix/virtualization-lms-core
that referenced
this issue
Nov 14, 2013
String interpolators for codegens
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Using just LMS numerics, the following code emits errors:
N is of type
Rep[Int]
xs is of type
Vector[Double]
val xbar = 1.0/N * sum(xs)
I am trying to compute the average here.
1.0
is of typeDouble
, but1.0/N
throws an error, since it does not know how to divide aDouble
byRep[Int]
.When i try
unit(1.0)/N
, it says it can't divideConst[Double]
.The text was updated successfully, but these errors were encountered: