Calculator Constructor

Initializes a new instance of the Calculator class.

Definition

Namespace: ClassicCalculator
Assembly: ClassicCalculator (in ClassicCalculator.dll) Version: 1.0.0+5cef018da377eef51dd690d3240ce68b7f7e05df
C#
public Calculator(
	int displayLength,
	ILogger<Calculator>? logger = null
)

Parameters

displayLength  Int32
The display length of the calculator, i.e. the number of digits that may be displayed.
logger  ILoggerCalculator  (Optional)
The logger instance for logging calculator operations.

Example

C#
var calculator = new Calculator(10);

Exceptions

ArgumentOutOfRangeExceptionThrown when the display length is out of the valid range (1 to MaxDisplayLength).

See Also