Fix()

Fix any undefined values in an array

FIX array=Array value=Any except Array Replaces any instances of "undefined" in an array.

example:

	# Fix undefined results to 999
	>> fill a -4.0 1.0
	>> printn 10/a
	[-2.5 -3.33333333333333 -5.0 -10.0  _  ...] Array(6 )
	>> fix a 999.0
	>> printn a
	[-2.5 -3.33333333333333 -5.0 -10.0 999.0 ...] Array(6 )

Note: See Unfix() for replacing sentinel values with "_" on data import.

Fix

Open GENIE caters for situations where an element of an array has an undefined value. This value is correctly propagated through all internal operations but can cause problems, especially when exporting data. To get round this problem, the Fix() command is used to replace any instances of an undefined value in an array with a specific sentinel value.

To go the other way, for example with imported data which, say, has undefined values represented by a specific number, the Unfix() command can be used.

Parameters:

Array (Array)

The array containing one or more undefined values to be fixed.

Value (Any except an array)

A value of the same type as the array with which to replace any undefined values.

RESULT = (Array)

An array of the same type as the original but with all undefined values replaced with a sentinal value of the correct type.