Skip to content

Nullable parameter results in duplicate reduced OpInfos #154

@hinerm

Description

@hinerm

We currently have two division ops for RealTypeMath - one trinary, one binary.

These two methods should be written as a single function with a @Nullable like:

/**
 * Sets the real component of an output real number to the division of the
 * real component of two input real numbers.
 * @input input1
 * @input input2
 * @input dbzVal
 * @container output
 * @implNote op names='math.div, math.divide'
 */
public static <I1 extends RealType<I1>, I2 extends RealType<I2>, O extends RealType<O>> void divider(I1 input1, I2 input2, @Nullable Double dbzVal, O output)
{
	if (Objects.nonNull(dbzVal) && (input2.getRealDouble() == 0)) {
		output.setReal(dbzVal);
	}
	else {
		output.setReal(input1.getRealDouble() / input2.getRealDouble());
	}
}

But when that happens the division tests fail, showing multiple copies of the reduced Opinfo

I'm not sure why. I did not test if other @Nullable ops are actually being called via their reduced infos, or just the full info.

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions