MathException

MathException Methods

MathException() | Constructor for the MathException class |

IsIntegerExpression() | Returns true if the expression is an integer expression |

IsFloatExpression() | Returns true if the expression is a floating point expression |

Value1() | First value in the operation |

Value2() | Second value in the operation (if applicable) |

OperatorId() | Returns the operator used in the expression |

MathException Constants

Constant Data Item | Data Type | Value |

MathException.Addition | int | 1 |

MathException.Subtraction | int | 2 |

MathException.Multiplication | int | 3 |

MathException.Division | int | 4 |

MathException.Exponentiation | int | 5 |

MathException.Modulus | int | 6 |

MathException.Log | int | 7 |

MathException.NaturalLog | int | 8 |

MathException.Sqrt | int | 9 |

MathException.ArcSin | int | 10 |

MathException.ArcCos | int | 11 |

Derived Classes

OverflowException, DomainException, DivideByZeroException

See Also

Class Hierarchy, Thread, Primitive Framework

public method MathException(float Value, float Value2, int OperatorId, bool IsFloatExpression = true)

Parameters

Value1

The first value in the expression

Value2

The second value in the expression (if applicable)

OperatorId

Integer Id associated with operator which encountered the math error

IsFloatExpression

True if float expression and false if not (true by default)

Return Value

None

Description

Constructor for the MathException class.

MathException Class

public method<bool> IsIntegerExpression()

Parameters

None

Return Value

True if integer expression

Description

This method returns true if the expression which caused the exception is an interger expression and false if not.

MathException Class

public method<bool> IsFloatExpression()

Parameters

None

Return Value

True if float expression

Description

This method returns true if the expression which caused the exception is a floating point expression and false if not.

MathException Class

public method<float> Value1()

Parameters

None

Return Value

First value in the expression

Description

This method returns the first value in the expression which caused the exception.

The return value is always a floating point value, whether the expression is an integer or floating point expression. If integer, the method converts the value to a float and returns it.

MathException Class

public method<float> Value2()

Parameters

None

Return Value

Second value in the expression

Description

This method returns the second value in the expression which caused the exception, if applicable. Many expressions have a single operand (primitive instance methods such as int.Add(), etc.), in which case this method won't apply (returns 0.0 in that case).

The return value is always a floating point value, whether the expression is an integer or floating point expression. If integer, the method converts the value to a float and returns it.

MathException Class

public method<int> OperatorId()

Parameters

None

Return Value

Operator Id associated with exception

Description

This method returns the id value for the operator which was used in the expression which caused the exception. The integer values associated with the operators which can cause an exception are provided as constants within this class.

MathException Class