| Prev | Start of Chapter | Next Chapter | Contents | Index | (25 out of 25)

Arithmetic Function of Two Arguments


The Arithmetic Function of Two Arguments block lets you use a function or procedure as a block in a NeurOn-Line diagram. The block applies the function or procedure to its input values and passes a single result. Specify the name of the routine in the field Arithmetic Function.

You can use any:


Note: The input value for this block can be text, symbolic, or numeric.

Using Built-in G2 Function

You can set the field Arithmetic Function to any of these built-in G2 functions:

arctan
average
expt
max
min
quotient
random
remainder

For example, this diagram computes 25.


Using a User-Defined Function

You can use any user-defined function that accepts two quantitative arguments and returns one value. Set the field Arithmetic Function to the name of the function.

For example, this diagram uses the Pythagorean Theorem to figure the size of a right triangle's hypotenuse given the sizes of the other two sides.


Using a Procedure

You can use a procedure that accepts six arguments, described below, and returns a single value. Set the field Arithmetic Function to the name of your function. The block passes the procedure's return value as its output value. The block automatically passes the collection-time and quality of the block's input data path.

Argument Type Description
input-value-1
value
The block's top input value.
collection-time-1
float
The collection-time of the block's top input path.
quality-1
symbol
The quality of the block's top input path.
input-value-2
value
The block's bottom input value.
collection-time-2
float
The collection-time of the block's bottom input path.
quality-2
symbol
The quality of the block's bottom input path.

For example, this diagram uses the Pythagorean Theorem to figure the size of a right triangle's hypotenuse given the sizes of the other two sides.


Configuring

This is the configuration panel for Arithmetic Function of Two Arguments.


Field Description
Arithmetic Function
The name of the function to apply to this block's two input values.

See Also

For more information on menu choices that are not described in this section, see the sections below.

Click here for more information...
Basic Block Behavior
Editing Attribute Displays

| Prev | Start of Chapter | Next Chapter | Contents | Index | (25 out of 25)

Copyright © 1996, Gensym Corporation, Inc.