Files
Rauhul Varma 10d80282e5 Enable swift-format checking (#711)
Adopts the common swift-mmio and swift-argument-parser format and enables CI checking.

Fixes: #702
2025-02-10 14:58:19 -08:00

27 lines
806 B
Swift

//===----------------------------------------------------------*- swift -*-===//
//
// This source file is part of the Swift Argument Parser open source project
//
// Copyright (c) 2020 Apple Inc. and the Swift project authors
// Licensed under Apache License v2.0 with Runtime Library Exception
//
// See https://swift.org/LICENSE.txt for license information
//
//===----------------------------------------------------------------------===//
struct SplitMix64: RandomNumberGenerator {
private var state: UInt64
init(seed: UInt64) {
self.state = seed
}
mutating func next() -> UInt64 {
self.state &+= 0x9e37_79b9_7f4a_7c15
var z: UInt64 = self.state
z = (z ^ (z &>> 30)) &* 0xbf58_476d_1ce4_e5b9
z = (z ^ (z &>> 27)) &* 0x94d0_49bb_1331_11eb
return z ^ (z &>> 31)
}
}