Arith Sumn: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „== Schema == Bild:arith_sumn.jpg At least the first 2 inputs must be connected and both must have received a value for the action to trigger ("and" input…“)
 
Zeile 7: Zeile 7:
== Operation ==
== Operation ==
This block returns the sum of all given numbers, i.e.
This block returns the sum of all given numbers, i.e.
''number1'' + ''number2'' + ... + ''number10''
''sum'' = ''number1'' + ''number2'' + ... + ''number10''
unconnected pins are ignored.


== Automatic Type Conversion ==
== Automatic Type Conversion ==

Version vom 19. Dezember 2014, 01:51 Uhr

Schema[Bearbeiten]

Arith sumn.jpg

At least the first 2 inputs must be connected and both must have received a value for the action to trigger ("and" input behavior). If present, additional values from other pins are added to form the sum. If no value is present, or the pin is unconencted, a 0 (zero) is taken as operand.

Operation[Bearbeiten]

This block returns the sum of all given numbers, i.e.

sum = number1 + number2 + ... + number10

unconnected pins are ignored.

Automatic Type Conversion[Bearbeiten]

The block allows 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 number 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 smallInteger, a largeInteger representation with an arbitrary number of digits is automatically choosen (32, 64, 96, 128... bits).

(2) If the fraction can be reduced to an integral value, an Integer is returned (i.e. 6/3 will be reduced to 2)

Revisions[Bearbeiten]

This block has been in the Standard Library since 0.1.


Back to Standard Library.
Previous: Arith [ Sum ]
Next: Arith [ Sum+ ]



Copyright © 2014-2024 eXept Software AG