Skip to content

Modern Math NextNormalP

Paul Squires edited this page Sep 30, 2026 · 5 revisions

Home › Math Library › Math Library › NextNormalP

NextNormalP

Syntax

NextNormalP( mean, sd )

Examples

#import "std/numeric"
using FB

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
Source: docs/math/math.txt in the FBC-Modern repository.

Clone this wiki locally