#!/usr/bin/env swift; import Foundation import Utils // Begin Main let a:Int = 326 let b:Int = -1 let c:Int = 2015 let i1:Int64 = 65000 let i2:Int64 = -2 let i3:Int64 = 3261963 let f1:Double = 3.1415926 let f2:Double = 2.99792458e9 let f3:Double = 1.234e-4 let c1:Int = Utils.ord("A") let c2:Int = Utils.ord("B") let c3:Int = Utils.ord("C") let s1:String = "Apples" let s2:String = "and" let s3:String = "Bananas" let b1:Bool = true let b2:Bool = false print(String(format:"Decimals: %d %d %d", a, b, c)) print(String(format:"Hexadecimals: %#x %#x %#x", a, b, c)) print(String(format:"Long Decimals: %d %d %d", i1, i2, i3)) print(String(format:"Long Hexadecimals: %016x %016x %016x", i1, i2, i3)) print(String(format:"Fixed FP: %f %f %f", f1, f2, f3)) print(String(format:"Exponential FP: %e %e %e", f1, f2, f3)) print(String(format:"General FP: %g %g %g", f1, f2, f3)) print(String(format:"General FP with precision: %.2g %.2g %.2g", f1, f2, f3)) print(String(format:"Boolean: %@ %@", String(b1), String(b2))) print(String(format:"Character: %@ %@ %@", Utils.chr(c1), Utils.chr(c2), Utils.chr(c3))) print(String(format:"String: %@ %@ %@", s1, s2, s3)) exit(EXIT_SUCCESS)