Arith Sum: Unterschied zwischen den Versionen
Cg (Diskussion | Beiträge) |
Cg (Diskussion | Beiträge) |
||
Zeile 57: | Zeile 57: | ||
(1) Integers are not limited to a 32bit range. If the result does not fit into a so called SmallInteger, a largeInteger representation with an arbitrary number of digits is automatically chosen (32, 64, 96, 128... bits). The reverse is also true: if the result of a largeInteger operation fits the smallInteger range, a compact representation is used. |
(1) Integers are not limited to a 32bit range. If the result does not fit into a so called SmallInteger, a largeInteger representation with an arbitrary number of digits is automatically chosen (32, 64, 96, 128... bits). The reverse is also true: if the result of a largeInteger operation fits the smallInteger range, a compact representation is used. |
||
(2) If the fraction can be reduced to an integral value, an Integer is returned (i.e. 6/3 will be reduced to 2). Fractions are also reduced to the greater common divisor (i.e. |
(2) If the fraction can be reduced to an integral value, an Integer is returned (i.e. (2/3 + 4/3 will result in 6/3, which will be reduced to 2). Fractions are also reduced to the greater common divisor (i.e. 1/6 + 1/6 will give 1/3 as result). |
||
== Revisions == |
== Revisions == |
Version vom 14. August 2020, 09:09 Uhr
Inhaltsverzeichnis
Schema[Bearbeiten]
Trigger[Bearbeiten]
Both inputs must be connected and both must have received a value for the action to trigger ("And" input behavior)
Operation[Bearbeiten]
Computes the arithmetic sum of its input values:
sum := number1 + number2
Automatic Type Conversion[Bearbeiten]
The arithmetic blocks allow for mixed mode arithmetic. This means that all combinations of Float, Double, Integer, LargeInteger and Fractional numbers are allowed as input.
Depending on the input type(s), the output value is generated as:
in1 | in2 | out | |
Integer | Integer | Integer (1) | |
Integer | Float / Double | Float / Double | |
Integer | Fraction | Fraction (2) | |
Fraction | Fraction | Fraction (2) | |
Fraction | Float / Double | Float / Double | |
Float / Double | Float / Double | Float / Double |
Notes:
(1) Integers are not limited to a 32bit range. If the result does not fit into a so called SmallInteger, a largeInteger representation with an arbitrary number of digits is automatically chosen (32, 64, 96, 128... bits). The reverse is also true: if the result of a largeInteger operation fits the smallInteger range, a compact representation is used.
(2) If the fraction can be reduced to an integral value, an Integer is returned (i.e. (2/3 + 4/3 will result in 6/3, which will be reduced to 2). Fractions are also reduced to the greater common divisor (i.e. 1/6 + 1/6 will give 1/3 as result).
Revisions[Bearbeiten]
This block is in the Standard Library since 0.1.