         return results
     }
 }
-//extension Float : FloatingArithmetic {}
-
-//public protocol VectorArithmetic {
-//    func +(rhs: VectorArithmetic, lhs: VectorArithmetic) -> VectorArithmetic
-//}
-//
-//public extension Array where Element : FloatingArithmetic {
-//    //func +(rhs: Vector)
-//}
-//
-//public extension Double {
-//    
-//}
 
 func +<T: VectorArithmetic>(lhs: [T], rhs: [T]) -> [T] {
     return T.add(lhs, rhs)


import Foundation

public protocol VectorArithmetic {
    static func add(x: [Self], _ y: [Self]) -> [Self]
    static func multiply(x: [Self], _ y: [Self]) -> [Self]
    init<T: FloatLiteralConvertible>(value: T)
}

extension Double : VectorArithmetic {
    public init<T: FloatLiteralConvertible>(value: T) {
        self = Double(value: value)
    }
    
    public static func add(x: [Double], _ y: [Double]) -> [Double] {
        var results = [Double](y)

func *<T: VectorArithmetic>(lhs: [T], rhs: T) -> [T] {
    let rhsVect = Array<T>(count: lhs.count, repeatedValue: rhs)
    return T.multiply(lhs, rhsVect)
}