If you want just scalar, you can change the definition of `T` in this case to:
# scalar multiplication
proc `*`*[N: static[int]; T: SomeFloat](x: T; y: Dual[N, T]): Dual[N, T] =
result.real = x * y.real
for i in 0..N-1:
result.dual[i] = x * y.dual[i]
# non-scalar multiplication
proc `*`*[N: static[int]; T: Dual](x: T; y: Dual[N, T]): Dual[N, T] =
# implementation here
discard
Run
- Dual number type whiterock
- Re: Dual number type jyapayne
- Re: Dual number type jyapayne
- Re: Dual number type whiterock
