struct Float
Float
is PythonConvertible
via the Double
implementation.
-
Declaration
public init?(_ pythonObject: PythonObject)
-
Declaration
public var pythonObject: PythonObject { get }
-
Produces a random value from the standard uniform distribution.
Declaration
static func randomUniform(state: RandomState? = nil) -> Float
Parameters
state
An optional
RandomState
instance. Ifnil
,RandomState.global
will be used. -
Produces a random value from a normal distribution using the Box-Muller method.
Declaration
static func randomNormal(mean: Float = 0, stddev: Float = 1, state: RandomState? = nil) -> Float
Parameters
mean
The mean of the normal distribution.
stddev
The standard deviation of the normal distribution.
state
An optional
RandomState
instance. Ifnil
,RandomState.global
will be used.