//: [Previous](@previous)

/*
 
 Find a human-friendly explanation into this coding challenge at http://pabloduo.com/2018/06/10/print-bits-of-real-number
 
 Given a real number between 0 and 1 (e.g., 0.625) that is passed in as a float, write a program that returns its binary representation.
 
 
 EXAMPLE
 
    Input:  n = 0.625
 
    Output: "10100000000000000000000"
 
 */

func toBinary(num: Float32) -> String {
    // TODO: Write some code to solve this coding challenge
    fatalError("TODO: Write some code to solve this challenge...") 
}


// Assert a few test cases
toBinary(num: 0.625) ?>> "10100000000000000000000"
toBinary(num: 0.6)   ?>> "10011001100110011001101"
toBinary(num: 0.541) ?>> "10001010011111101111101"
toBinary(num: 0.5)   ?>> "10000000000000000000000"

//: [Next](@next)
