// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
contract EnhancedPureFunction {
// Event declaration for logging
event ValueComputed(int inputData, int outputData);
// Function to multiply the input by 10
function multiplyByTen(int _data) public returns (int) {
require(_data >= 0, "Input must be non-negative");
int result = _data * 10;
emit ValueComputed(_data, result); // Log the computation
return result;
}
// Additional function to divide the input by 10
function divideByTen(int _data) public returns (int) {
require(_data != 0, "Input must not be zero");
int result = _data / 10;
emit ValueComputed(_data, result); // Log the computation
return result;
}
}