         let mag = magnitude(units)
         return (mag.toMagnitude(units), mag)
     }
-
-    internal static func allMagnitudes() -> [Int] {
-        allCases.map {Int(log10($0.rawValue))}
-    }
-
-    var symbol:String {
-        let symbols = ["", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi"]
-        return symbols[BinaryMagnitude.allCases.firstIndex(of: self)!]
-    }
 }


        //get index of case <= magnitude...
        // clamp to upper/lower bounds for values outside range
        var index: Int? = allMagnitudes().lastIndex(where: {$0 <= mag})
        if index == nil {
            index = units.magnitude < 1.0 ? 0 : (allCases.count - 1)
        }

    case exbi = 0x01p60
    case zebi = 0x01p70
    case yobi = 0x01p80

    static func powers() -> [Int] {
        allCases.map {Int(log10($0.rawValue))}
    }

    var symbol:String {
        let symbols = ["", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei", "Zi", "Yi"]
        return symbols[BinaryMagnitude.allCases.firstIndex(of: self)!]
    }
}

//Generic protocol for converting values to and from orders of magnitude
protocol MagnitudeConversion {
    associatedtype T

    func toMagnitude(_ units: Double, fromMagnitude: T) -> Double
