From 7d4c20f9db656440c2ff6bbdba8d863a20827ab7 Mon Sep 17 00:00:00 2001 From: Hugo Locurcio Date: Fri, 2 Jul 2021 17:47:17 +0200 Subject: [PATCH] Improve and clarify documentation for RandomNumberGenerator --- doc/classes/@GlobalScope.xml | 6 +++--- doc/classes/RandomNumberGenerator.xml | 12 ++++++------ 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index daabc2c83b..66511f5845 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -778,7 +778,7 @@ - Returns a random floating point value on the interval [code][0, 1][/code]. + Returns a random floating point value between [code]0.0[/code] and [code]1.0[/code] (inclusive). [codeblock] randf() # Returns e.g. 0.375671 [/codeblock] @@ -792,7 +792,7 @@ - Random range, any floating point value between [code]from[/code] and [code]to[/code]. + Returns a random floating point value on the interval between [code]from[/code] and [code]to[/code] (inclusive). [codeblock] prints(randf_range(-10, 10), randf_range(-10, 10)) # Prints e.g. -3.844535 7.45315 [/codeblock] @@ -819,7 +819,7 @@ - Random range, any 32-bit integer value between [code]from[/code] and [code]to[/code] (inclusive). If [code]to[/code] is lesser than [code]from[/code] they are swapped. + Returns a random signed 32-bit integer between [code]from[/code] and [code]to[/code] (inclusive). If [code]to[/code] is lesser than [code]from[/code], they are swapped. [codeblock] print(randi_range(0, 1)) # Prints 0 or 1 print(randi_range(-10, 1000)) # Prints any number from -10 to 1000 diff --git a/doc/classes/RandomNumberGenerator.xml b/doc/classes/RandomNumberGenerator.xml index 6fcb79b5fe..9c84cdd03e 100644 --- a/doc/classes/RandomNumberGenerator.xml +++ b/doc/classes/RandomNumberGenerator.xml @@ -23,7 +23,7 @@ - Generates a pseudo-random float between [code]0.0[/code] and [code]1.0[/code] (inclusive). + Returns a pseudo-random float between [code]0.0[/code] and [code]1.0[/code] (inclusive). @@ -34,7 +34,7 @@ - Generates a pseudo-random float between [code]from[/code] and [code]to[/code] (inclusive). + Returns a pseudo-random float between [code]from[/code] and [code]to[/code] (inclusive). @@ -45,14 +45,14 @@ - Generates a [url=https://en.wikipedia.org/wiki/Normal_distribution]normally-distributed[/url] pseudo-random number, using Box-Muller transform with the specified [code]mean[/code] and a standard [code]deviation[/code]. This is also called Gaussian distribution. + Returns a [url=https://en.wikipedia.org/wiki/Normal_distribution]normally-distributed[/url] pseudo-random number, using Box-Muller transform with the specified [code]mean[/code] and a standard [code]deviation[/code]. This is also called Gaussian distribution. - Generates a pseudo-random 32-bit unsigned integer between [code]0[/code] and [code]4294967295[/code] (inclusive). + Returns a pseudo-random 32-bit unsigned integer between [code]0[/code] and [code]4294967295[/code] (inclusive). @@ -63,14 +63,14 @@ - Generates a pseudo-random 32-bit signed integer between [code]from[/code] and [code]to[/code] (inclusive). + Returns a pseudo-random 32-bit signed integer between [code]from[/code] and [code]to[/code] (inclusive). - Setups a time-based seed to generator. + Setups a time-based seed to for this [RandomNumberGenerator] instance. Unlike the [@GlobalScope] random number generation functions, different [RandomNumberGenerator] instances can use different seeds.