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

Reply via email to