Skip to content

Commit

Permalink
providing better examples in playgroung
Browse files Browse the repository at this point in the history
  • Loading branch information
caynan committed May 29, 2017
1 parent 44a6302 commit ced1551
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions Horus.playground/Contents.swift
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ let i: Int16 = try bin.scanValue(start: 0, length: 2)
let i2: Int16 = try bin.get(at: 0)

// Working with Float point numbers.
let floatBin: Binary = [0x71, 0x3d, 0x0a, 0xd7, 0xa3, 0x10, 0x45, 0x40]
let f: Double = try floatBin.get(at: 0)
let doubleBin: Binary = [0xc9, 0xe5, 0x3f, 0xa4, 0xdf, 0xbe, 0x05, 0x40]
let e: Double = try doubleBin.get(at: 0)

let floatBin: Binary = [0xd0, 0x0f, 0x49, 0x40]
let pi: Float = try floatBin.scanValue(start: 0, length: 4)

// Rolling with Strings.
let binStr: Binary = [0x48, 0x6F, 0x72, 0x75, 0x73, 0x00] // => "Horus\0"
Expand Down

0 comments on commit ced1551

Please sign in to comment.