Arith Sum+: Unterschied zwischen den Versionen

Aus expecco Wiki (Version 2.x)
Zur Navigation springen Zur Suche springen
(Die Seite wurde neu angelegt: „== Schema == Bild:arith_sum+.jpg This block replaces the Arith [ SumN ] block. It allows for an arbitrary number of input pins. == Ope…“)
 
 
(10 dazwischenliegende Versionen von 2 Benutzern werden nicht angezeigt)
Zeile 1: Zeile 1:
== Schema ==
== Schema ==


[[Bild:arith_sum+.jpg]]
[[Bild:arith_sum+.png]]


This block replaces the [[Arith Sumn| Arith [ SumN ] ]] block. It allows for an arbitrary number of input pins.
This block obsoletes the "[[Arith Sumn|Arith [ SumN ] ]]" block. It has the same semantics, but allows for an arbitrary number of input pins.


== Operation ==
== Operation ==
This block returns the sum of all given numbers, i.e. ''number1'' + ''number2'' + ... + ''numberN''.
This block returns the sum of all given numbers, i.e.
''sum'' = ''number1'' + ''number2'' + ... + ''numberN''.


== Automatic Type Conversion ==
== Automatic Type Conversion ==
The block allows for mixed mode arithmetic. This means that all combinations of Float, Double, Integer, LargeInteger and Fractional numbers are allowed as input.
The block allows for mixed mode arithmetic. This means that all combinations of Float, Double, Integer, LargeInteger, Complex, Fractional and ScaledDecimal numbers are allowed as input.
<br>However, due to the pins being of type "Number", non-numbers (such as physical values or vectors) are not handled (unless type checks are disabled at the pins). Use the new [[ Arith Sum Any|"Arith [ Sum Any ]" ]] block for this.<br>


Depending on the input type(s), the output number is generated as:
Depending on the input type(s), the output number is generated as:
Zeile 16: Zeile 18:
|in1
|in1
|in2
|in2
|
|out
|out
|-
|-
|Integer
|Integer
|Integer
|Integer
|
|Integer (1)
|Integer (1)
|-
|-
|Integer
|Integer
|Float / Double
|Float / Double
|
|Float / Double
|Float / Double
|-
|-
|Integer
|Integer
|Fraction
|Fraction
|
|Fraction (2)
|Fraction (2)
|-
|-
|Fraction
|Fraction
|Fraction
|Fraction
|
|Fraction (2)
|Fraction (2)
|-
|-
|Fraction
|Fraction
|Float / Double
|Float / Double
|
|Float / Double
|Float / Double
|-
|-
|Float / Double
|Float / Double
|Float / Double
|Float / Double
|
|Float / Double
|Float / Double
|}
|}
Zeile 45: Zeile 54:
Notes:
Notes:
<BR>
<BR>
(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).
(1) Integers are not limited to a 32 or 64bit range. If the result does not fit into a smallInteger, a largeInteger representation with an arbitrary number of digits is automatically chosen (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)
(2) If the fraction can be reduced to an integral value, an Integer is returned (i.e. 6/3 will be reduced to 2)
Zeile 58: Zeile 67:
<hr>
<hr>
Back to [[Standard_Library#Arithmetic|Standard Library]].<br>
Back to [[Standard_Library#Arithmetic|Standard Library]].<br>
Previous: [[Arith SumN|Arith [ SumN ]]]<br>
Previous: [[Arith Sumn|Arith [ SumN ]]]<br>
Next: [[Arith Distance|Arith [ Distance ]]]
Next: [[Arith Distance|Arith [ Distance ]]]



Aktuelle Version vom 19. September 2021, 09:27 Uhr

Schema[Bearbeiten]

Datei:Arith sum+.png

This block obsoletes the "Arith [ SumN ] " block. It has the same semantics, but allows for an arbitrary number of input pins.

Operation[Bearbeiten]

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

sum = number1 + number2 + ... + numberN.

Automatic Type Conversion[Bearbeiten]

The block allows for mixed mode arithmetic. This means that all combinations of Float, Double, Integer, LargeInteger, Complex, Fractional and ScaledDecimal numbers are allowed as input.
However, due to the pins being of type "Number", non-numbers (such as physical values or vectors) are not handled (unless type checks are disabled at the pins). Use the new "Arith [ Sum Any ]" block for this.

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 32 or 64bit range. If the result does not fit into a smallInteger, a largeInteger representation with an arbitrary number of digits is automatically chosen (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 2.3.0.


Back to Standard Library.
Previous: Arith [ SumN ]
Next: Arith [ Distance ]



Copyright © 2014-2024 eXept Software AG