Skip to reading
GDScript Programming & Godot

min()

Edition 0.86.4.1 HF1

0.86.4.1 Hotfix 1 edition. Earlier lessons and screenshots retain their original version context; revised references and supplements describe the newer behavior.

Download PDFView PDF page
On this page

Earlier edition reference / Current 0.86.4.0 property paths > p. 350

Code example
min(...) -> Variant

Smallest supplied value; match typed/variadic signature.

minf()#

Code example
minf(a: float, b: float) -> float

Smallest supplied value; match typed/variadic signature.

mini()#

Code example
mini(a: int, b: int) -> int

Smallest supplied value; match typed/variadic signature.

move_toward()#

Code example
move_toward(from: float, to: float, delta: float) -> float

Move a value toward a target without overshooting.

nearest_po2()#

Code example
nearest_po2(value: int) -> int

Smallest suitable power-of-two boundary for a positive integer.

pingpong()#

Code example
pingpong(value: float, length: float) -> float

Reflect a repeating value back and forth across an interval.

posmod()#

Code example
posmod(x: int, y: int) -> int

Remainder/modulo variants; pay attention to negative inputs and positive wrapping behavior.

pow()#

Code example
pow(base: float, exp: float) -> float

Exponential, natural logarithm, power or square root. Check the mathematical domain.

Page 312 of 378Permalink
Go to page