diff options
author | RĂ©mi Verschelde <remi@verschelde.fr> | 2021-05-04 15:15:52 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-04 15:15:52 +0200 |
commit | c9e874b62db78902b4963e656b3b97b57e93c42f (patch) | |
tree | 7345c8c6a294e6e467aa0e67c22a22a87db0dffd /doc/classes | |
parent | ea9cab3e76b7cb8754b6d64102101f79a253ed8d (diff) | |
parent | e196733e880792ca75fce72e642383c777280aa5 (diff) |
Merge pull request #48442 from akien-mga/posmod-int64_t
Re-bind posmod, use int64_t instead of int
Diffstat (limited to 'doc/classes')
-rw-r--r-- | doc/classes/@GlobalScope.xml | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/doc/classes/@GlobalScope.xml b/doc/classes/@GlobalScope.xml index 95108f1613..af66a11fe5 100644 --- a/doc/classes/@GlobalScope.xml +++ b/doc/classes/@GlobalScope.xml @@ -652,6 +652,31 @@ Converts a 2D point expressed in the polar coordinate system (a distance from the origin [code]r[/code] and an angle [code]th[/code]) to the cartesian coordinate system (X and Y axis). </description> </method> + <method name="posmod"> + <return type="int"> + </return> + <argument index="0" name="x" type="int"> + </argument> + <argument index="1" name="y" type="int"> + </argument> + <description> + Returns the integer modulus of [code]x/y[/code] that wraps equally in positive and negative. + [codeblock] + for i in range(-3, 4): + print("%2d %2d %2d" % [i, i % 3, posmod(i, 3)]) + [/codeblock] + Produces: + [codeblock] + -3 0 0 + -2 -2 1 + -1 -1 2 + 0 0 0 + 1 1 1 + 2 2 2 + 3 0 0 + [/codeblock] + </description> + </method> <method name="pow"> <return type="float"> </return> |