Aztec® Programming Language
Version 1.1 Alpha 2

Copyright © 2010-2017, Aztec Development Group, All Rights Reserved

Download Aztec

Search        Contact Us

The Left ones think I'm right...

The Right ones think I'm wrong.

- Leon Russell

 

aztec.system.MathException

public class MathException from<ExceptionEvent>

Base

Event

ExceptionEvent

MathException

MathException is an abstract class which provides a framework for exceptions related to math processing with integer or floating objects, including overflow, domain and divide by zero exceptions. This class contains methods providing information about the failed operation.

 

Math exception events are created and fired internally by the Aztec VM when it encounters invalid mathematical operations on primitive data types. These exceptions can occur using primitive methods and using Aztec operators. The math exception classes can also be manually created and fired by user defined code.

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

See Also

  


MathException()

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


IsIntegerExpression()

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


IsFloatExpression()

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


Value1()

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


Value2()

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


OperatorId()

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

 

Copyright © 2010-2017

Aztec Development Group

All Rights Reserved

Download Aztec