Skip to content

Commit 0569822

Browse files
committed
Merge pull request #107166 from Calinou/doc-globalscope-wrap-exclusive
Clarify parameters in `@GlobalScope.wrap()` being inclusive/exclusive
2 parents 66e041d + 5404d98 commit 0569822

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed

doc/classes/@GlobalScope.xml

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1492,8 +1492,8 @@
14921492
<param index="1" name="min" type="Variant" />
14931493
<param index="2" name="max" type="Variant" />
14941494
<description>
1495-
Wraps the [Variant] [param value] between [param min] and [param max]. Can be used for creating loop-alike behavior or infinite surfaces.
1496-
Variant types [int] and [float] are supported. If any of the arguments is [float] this function returns a [float], otherwise it returns an [int].
1495+
Wraps the [Variant] [param value] between [param min] and [param max]. [param min] is [i]inclusive[/i] while [param max] is [i]exclusive[/i]. This can be used for creating loop-like behavior or infinite surfaces.
1496+
Variant types [int] and [float] are supported. If any of the arguments is [float], this function returns a [float], otherwise it returns an [int].
14971497
[codeblock]
14981498
var a = wrap(4, 5, 10)
14991499
# a is 9 (int)
@@ -1512,7 +1512,7 @@
15121512
<param index="1" name="min" type="float" />
15131513
<param index="2" name="max" type="float" />
15141514
<description>
1515-
Wraps the float [param value] between [param min] and [param max]. Can be used for creating loop-alike behavior or infinite surfaces.
1515+
Wraps the float [param value] between [param min] and [param max]. [param min] is [i]inclusive[/i] while [param max] is [i]exclusive[/i]. This can be used for creating loop-like behavior or infinite surfaces.
15161516
[codeblock]
15171517
# Infinite loop between 5.0 and 9.9
15181518
value = wrapf(value + 0.1, 5.0, 10.0)
@@ -1525,8 +1525,7 @@
15251525
# Infinite rotation (in radians)
15261526
angle = wrapf(angle + 0.1, -PI, PI)
15271527
[/codeblock]
1528-
[b]Note:[/b] If [param min] is [code]0[/code], this is equivalent to [method fposmod], so prefer using that instead.
1529-
[method wrapf] is more flexible than using the [method fposmod] approach by giving the user control over the minimum value.
1528+
[b]Note:[/b] If [param min] is [code]0[/code], this is equivalent to [method fposmod], so prefer using that instead. [method wrapf] is more flexible than using the [method fposmod] approach by giving the user control over the minimum value.
15301529
</description>
15311530
</method>
15321531
<method name="wrapi">
@@ -1535,7 +1534,7 @@
15351534
<param index="1" name="min" type="int" />
15361535
<param index="2" name="max" type="int" />
15371536
<description>
1538-
Wraps the integer [param value] between [param min] and [param max]. Can be used for creating loop-alike behavior or infinite surfaces.
1537+
Wraps the integer [param value] between [param min] and [param max]. [param min] is [i]inclusive[/i] while [param max] is [i]exclusive[/i]. This can be used for creating loop-like behavior or infinite surfaces.
15391538
[codeblock]
15401539
# Infinite loop between 5 and 9
15411540
frame = wrapi(frame + 1, 5, 10)

0 commit comments

Comments
 (0)