Skip to content

Instantly share code, notes, and snippets.

View drhurdle's full-sized avatar

Danny Hurdle drhurdle

View GitHub Profile
@drhurdle
drhurdle / Xoroshiro128Plus.swift
Last active May 20, 2016 19:27
Pseudo-Random Number generator utilizing xoroshiro128+ algorithm in Swift 2.2
import Foundation
/// Pseudo-Random Number generator utilizing xoroshiro128+ algorithm
/// translated from: http://xoroshiro.di.unimi.it/xoroshiro128plus.c
/// Example:
/*
var myRNG = RNG()
var x = myRNG.getRandomNumber(0,100)
var r = RNG(seed: 2345) // Seed is the same as {s} below