<commit_before>import * as $ from "./lib.js";

/* Arithmatic */

export function add(...operands) {
    return [].reduce.call(operands, function(a, b) {
	return a + b
    });
}

export function sub(...operands) {
    if (operands.length === 1) {
	return -operands[0];
    } else {
	let result = operands[0];
	for (var i = 1; i < operands.length; ++i) {
	    result -= operands[i];
	}
	return result;
    }
}

export function mul(operands) {
    return [].reduce .call(operands, function(a, b) {
	return a * b
    }, 1);
}

export function div(operands) {
    if (operands.length === 1) {
	return 1 / operands[0];
    } else {
	var result = operands[0];
	for (var i = 1; i < operands.length; ++i) {
	    result /= operands[i];
	}
	return result;
    }
}

/* Comparision */

export function compare(cmp, operands) {
    if (operands.length < 2) {
	throw new $.RacketCoreError("compare {0}",<commit_msg>runtime: Typo with operands arguments in number<commit_after>import * as $ from "./lib.js";

/* Arithmatic */

export function add(...operands) {
    return [].reduce.call(operands, function(a, b) {
	return a + b
    });
}

export function sub(...operands) {
    if (operands.length === 1) {
	return -operands[0];
    } else {
	let result = operands[0];
	for (var i = 1; i < operands.length; ++i) {
	    result -= operands[i];
	}
	return result;
    }
}

export function mul(...operands) {
    return [].reduce.call(operands, function(a, b) {
	return a * b
    }, 1);
}

export function div(...operands) {
    if (operands.length === 1) {
	return 1 / operands[0];
    } else {
	var result = operands[0];
	for (var i = 1; i < operands.length; ++i) {
	    result /= operands[i];
	}
	return result;
    }
}

/* Comparision */

export function compare(cmp, operands) {
    if (operands.length < 2) {
	throw new $.RacketCoreError("compare {0}",
{'fraction_non_alphanumeric': 0.17455138662316477, 'fraction_numerical': 0.013050570962479609, 'mean_word_length': 2.865546218487395, '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': '3367829', 'n_tokens_mistral': 692, 'n_tokens_neox': 673, 'n_words': 176}