Skip to content

Modern Math NextNormalP

Paul Squires edited this page Oct 19, 2026 · 5 revisions

Home › Math Library › Math Library › NextNormalP

NextNormalP

Returns a random value from a normal distribution with the given mean and deviation.

Syntax

NextNormalP( mean, sd )

Examples

#import "std/numeric"
using numeric

dim r as Rng = RngFromEntropy( )

'' Gaussian with a given mean and standard deviation
dim as float64 total = 0
for i as int32 = 1 to 2000
    total += r.NextNormalP( 100.0, 15.0 )
next
dim as float64 mean_ = total / 2000

print mean_ > 95 andalso mean_ < 105      '' -1 (true)

'' NextNormal( ) is the standard one -- mean 0, sd 1

Library: Math Library
Category: Math Library
Documented under: Nothing Becomes A Keyword

Clone this wiki locally