<commit_before>"""Calculator.operations

Module that contains the math operations used by Calculator.
"""


def add(a, b):
    """Add two numbers"""
    return a + b

def subtract(a, b):
    """TODO: fill me in"""
    return a - b

def multiply(a, b):
    """TODO: fill me in"""
    return a * b

def divide(a, b):
    """TODO: fill me in"""
    # TODO: Add error if div by zero
    if b != 0:
        return float(a) / b

def abs_val(a):
    """TODO: fill me in"""
    if a < 0:
        return a*-1
    return a

def floor(a):
    """TODO: fill me in"""
    if a < 0:
        return int(a) - 1
    return int(a)

def ceiling(a):
    """TODO: fill me in"""
    if a < 0:
        return int(a)
    elif a % 1 == 0:
        return a
    return int(a) + 1

def power(a, b):
    """TODO: fill me in"""
    return a ** b

def rounding(a):
    """TODO: fill me in"""
    return int(a + 0.5)<commit_msg>Added discriptions to operation functions<commit_after>"""Calculator.operations

Module that contains the math operations used by Calculator.
"""


def add(a, b):
    """Add two numbers"""
    return a + b

def subtract(a, b):
    """Subtracts two numbers"""
    return a - b

def multiply(a, b):
    """Multiplies two numbers"""
    return a * b

def divide(a, b):
    """Divides two number, returns error if div by zero"""
    if b != 0:
        return float(a) / b
    return "Error: Division by Zero"

def abs_val(a):
    """Returns the absolute value of a number"""
    if a < 0:
        return a*-1
    return a

def floor(a):
    """Returns the floor value of a number"""
    if a < 0:
        return int(a) - 1
    return int(a)

def ceiling(a):
    """Rerturns the ceiling value of a number"""
    if a < 0:
        return int(a)
    elif a % 1 == 0:
        return a
    return int(a) + 1

def power(a, b):
    """Raises the first number to the power of the second number"""
    return a ** b

def rounding(a):
    """Rounds a number to the nearest interger value"""
    return int(a + 0.5)
{'fraction_non_alphanumeric': 0.14128256513026052, 'fraction_numerical': 0.011022044088176353, 'mean_word_length': 2.3008264462809915, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '480565', 'n_tokens_mistral': 709, 'n_tokens_neox': 678, 'n_words': 274}