Class FpAddExceptionGenerator
- java.lang.Object
-
- ru.ispras.testbase.knowledge.floating.FpExceptionGenerator
-
- ru.ispras.testbase.knowledge.floating.add.FpAddExceptionGenerator
-
- All Implemented Interfaces:
Generator<FpNumber,FpException>
public final class FpAddExceptionGenerator extends FpExceptionGenerator
FpAddExceptionGenerator
implements a random generator targeted at the exceptions in the floating-point addition operation.
-
-
Constructor Summary
Constructors Constructor Description FpAddExceptionGenerator(FpFormat format)
Constructs a random generator.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
checkInexact(FpNumber[] operands)
Checks whether the operation causes the inexact exception.boolean
checkNormal(FpNumber[] operands)
Checks whether the operation does not cause exceptions.boolean
checkOverflow(FpNumber[] operands)
Checks whether the operation causes the overflow exception.boolean
checkUnderflow(FpNumber[] operands)
GeneratorResult<FpNumber>
generateInexact(FpNumber[] operands)
Tries to generate operands that cause the inexact exception.GeneratorResult<FpNumber>
generateNormal(FpNumber[] operands)
Tries to generate operands that do not cause exceptions.GeneratorResult<FpNumber>
generateOverflow(FpNumber[] operands)
Tries to generate operands that cause the overflow exception.GeneratorResult<FpNumber>
generateUnderflow(FpNumber[] operands)
Tries to generate operands that cause the underflow exception.-
Methods inherited from class ru.ispras.testbase.knowledge.floating.FpExceptionGenerator
check, generate
-
-
-
-
Constructor Detail
-
FpAddExceptionGenerator
public FpAddExceptionGenerator(FpFormat format)
Constructs a random generator.- Parameters:
format
- the operand format.
-
-
Method Detail
-
checkNormal
public boolean checkNormal(FpNumber[] operands)
Description copied from class:FpExceptionGenerator
Checks whether the operation does not cause exceptions.- Specified by:
checkNormal
in classFpExceptionGenerator
- Parameters:
operands
- the operation operands.- Returns:
true
if the operation does not cause exceptions;false
otherwise.
-
generateNormal
public GeneratorResult<FpNumber> generateNormal(FpNumber[] operands)
Description copied from class:FpExceptionGenerator
Tries to generate operands that do not cause exceptions.- Specified by:
generateNormal
in classFpExceptionGenerator
- Parameters:
operands
- the operation operands (operand[i] == null
if the i-th operation is not fixed; otherwiseoperand[i]
contains the operand value).- Returns:
- the operation operands.
-
checkOverflow
public boolean checkOverflow(FpNumber[] operands)
Description copied from class:FpExceptionGenerator
Checks whether the operation causes the overflow exception.- Specified by:
checkOverflow
in classFpExceptionGenerator
- Parameters:
operands
- the operation operands.- Returns:
true
if the operation causes the exception;false
otherwise.
-
generateOverflow
public GeneratorResult<FpNumber> generateOverflow(FpNumber[] operands)
Description copied from class:FpExceptionGenerator
Tries to generate operands that cause the overflow exception.- Specified by:
generateOverflow
in classFpExceptionGenerator
- Parameters:
operands
- the operation operands (operand[i] == null
if the i-th operation is not fixed; otherwiseoperand[i]
contains the operand value).- Returns:
- the operation operands.
-
checkUnderflow
public boolean checkUnderflow(FpNumber[] operands)
- Specified by:
checkUnderflow
in classFpExceptionGenerator
-
generateUnderflow
public GeneratorResult<FpNumber> generateUnderflow(FpNumber[] operands)
Description copied from class:FpExceptionGenerator
Tries to generate operands that cause the underflow exception.- Specified by:
generateUnderflow
in classFpExceptionGenerator
- Parameters:
operands
- the operation operands (operand[i] == null
if the i-th operation is not fixed; otherwiseoperand[i]
contains the operand value).- Returns:
- the operation operands.
-
checkInexact
public boolean checkInexact(FpNumber[] operands)
Description copied from class:FpExceptionGenerator
Checks whether the operation causes the inexact exception.- Specified by:
checkInexact
in classFpExceptionGenerator
- Parameters:
operands
- the operation operands.- Returns:
true
if the operation causes the exception;false
otherwise.
-
generateInexact
public GeneratorResult<FpNumber> generateInexact(FpNumber[] operands)
Description copied from class:FpExceptionGenerator
Tries to generate operands that cause the inexact exception.- Specified by:
generateInexact
in classFpExceptionGenerator
- Parameters:
operands
- the operation operands (operand[i] == null
if the i-th operation is not fixed; otherwiseoperand[i]
contains the operand value).- Returns:
- the operation operands.
-
-