Ch. 26, Property Wrapper, Gold Challenge

Here’s my solution which seems to work when I convert all of the Car’s properties to Float. Can someone verify that my solution is correct?

@propertyWrapper public struct Percentage<T: FloatingPoint> {
    private var storage: T
    private var upperBound: T
    
    public init(wrappedValue: T, upperBound: T = 1) {
        storage = wrappedValue
        self.upperBound = upperBound
    }
    
    public var wrappedValue: T {
        set {
            storage = newValue
        }
        get {
            return storage.clamped(to: 0...upperBound)
        }
    }
    
    public var projectedValue: T {
        get {
            return storage
        }
    }
}

public extension FloatingPoint {
    func clamped(to range: ClosedRange<Self>) -> Self {
        return max(min(self, range.upperBound), range.lowerBound)
    }
}
struct Car {
    @Percentage var fuelLevel: Float = 1.0
    @Percentage var wiperFluidLevel: Float = 0.5
    @Percentage(upperBound: 2.0) var stereoVolume: Float = 1.0
}