ProtoFlux:Div: Difference between revisions

From Resonite Wiki
Stub
 
Filled in this node page. (Enjoy all the reading :3)
Line 5: Line 5:
|Inputs=
|Inputs=
[
[
{"Name":"", "Type":"Dummy"},
{"Name":"A", "Type":"Dummy"},
{"Name":"", "Type":"Dummy"}
{"Name":"B", "Type":"Dummy"}
]
]
|Outputs=
|Outputs=
[
[
{"Name":"", "Type":"Dummy"}
{"Name":"*", "Type":"Dummy"}
]
]
|}}
|}}
The '''Div''' node takes in 2 inputs and returns the calculated result. The second input (<code>B</code>) will divide the first input (<code>A</code>) into sub sections (mathematically speaking), and the result will show how many of our first value will fit into the second value.
{{Note|If you want the remainder of a division, use the [[ProtoFlux:Value Mod|Value Mod]] node instead. If you want to divide over a set repeated range from a value, use the [[ProtoFlux:Value Repeat|Value Repeat]] node instead.|suggestion}}
{{Note|It is typically recommended to avoid dividing anything by <code>0</code>, it is undefined and returns <code>Infinity</code> in the [[FrooxEngine]]. Conversely, dividing anything by <code>Infinity</code> will return <code>0</code>.|danger}}
Division is non-commutative (known as [https://en.wikipedia.org/wiki/Anticommutative_property Anticommutative]), which means where you put your inputs matters.
== Inputs ==
=== A (Pseudo-Generic) ===
The value we have.
=== B (Pseudo-Generic) ===
The value we want to divide from (basically, how many times to cut our first value into to fit these many sub sections).
== Outputs ==
=== * (Pseudo-Generic) ===
The new result from this operation.
== Further Reading ==
=== Magic Numbers For Division ===
At a low level, computers use a special number to do multiplication for their division operations, known as a [https://en.wikipedia.org/wiki/Magic_number_(programming) magic number]. Each processor is different and may have a different number for calculations, but the video below should explain this concept a bit better.
<youtube>ssDBqQ5f5_0</youtube>
== See Also ==
* Wikipedia's definition of [https://en.wikipedia.org/wiki/Division_(mathematics) division].
* Microsoft's documentation on the [https://learn.microsoft.com/en-us/dotnet/csharp/language-reference/operators/arithmetic-operators division] operator.


[[Category:ProtoFlux:Stubs]]
[[Category:ProtoFlux:Stubs]]
[[Category:ProtoFlux:Operators]]
[[Category:ProtoFlux:Operators]]

Revision as of 07:20, 27 June 2024

÷
A
*
B
Operators

The Div node takes in 2 inputs and returns the calculated result. The second input (B) will divide the first input (A) into sub sections (mathematically speaking), and the result will show how many of our first value will fit into the second value.

If you want the remainder of a division, use the Value Mod node instead. If you want to divide over a set repeated range from a value, use the Value Repeat node instead.
It is typically recommended to avoid dividing anything by 0, it is undefined and returns Infinity in the FrooxEngine. Conversely, dividing anything by Infinity will return 0.

Division is non-commutative (known as Anticommutative), which means where you put your inputs matters.

Inputs

A (Pseudo-Generic)

The value we have.

B (Pseudo-Generic)

The value we want to divide from (basically, how many times to cut our first value into to fit these many sub sections).

Outputs

* (Pseudo-Generic)

The new result from this operation.

Further Reading

Magic Numbers For Division

At a low level, computers use a special number to do multiplication for their division operations, known as a magic number. Each processor is different and may have a different number for calculations, but the video below should explain this concept a bit better.

See Also

  • Wikipedia's definition of division.
  • Microsoft's documentation on the division operator.