mirror of
https://github.com/godotengine/godot-docs.git
synced 2026-01-05 22:09:56 +03:00
Simplify mul/div/remainder operator text
IMO this is a much better description. It's to the point, and if anyone has further questions, they can look up how the C++ operators work.
This commit is contained in:
@@ -264,16 +264,11 @@ The following is the list of supported operators and their precedence.
|
||||
+---------------------------------------------------------------+-----------------------------------------+
|
||||
| ``*`` ``/`` ``%`` | Multiplication / Division / Remainder |
|
||||
| | |
|
||||
| | NOTE: The result of these operations |
|
||||
| | depends on the operands types. If both |
|
||||
| | are Integers, then the result will be |
|
||||
| | an Integer. That means 1/10 returns 0 |
|
||||
| | instead of 0.1. If at least one of the |
|
||||
| | operands is a float, then the result is |
|
||||
| | a float: float(1)/10 or 1.0/10 return |
|
||||
| | both 0.1. |
|
||||
| | NOTE2: Remainder/Modulo only works on |
|
||||
| | int. For floats use built in fmod() |
|
||||
| | These operators have the same behavior |
|
||||
| | as C++. Integer division is truncated |
|
||||
| | rather than returning a fractional |
|
||||
| | number, and the % operator is only |
|
||||
| | available for ints ("fmod" for floats) |
|
||||
+---------------------------------------------------------------+-----------------------------------------+
|
||||
| ``+`` | Addition / Concatenation of Arrays |
|
||||
+---------------------------------------------------------------+-----------------------------------------+
|
||||
|
||||
Reference in New Issue
Block a user