<commit_before>/* automaton
 * (c) 2013 <NAME>
 * The source code of this project is distributed under the terms of the
 * simplified BSD license. See the LICENSE file for details.
 */


#include "conv/bcd.h"


uint8_t bcd_decode_packed(uint8_t bcd_p) {
	uint8_t tens = (bcd_p >> 4);
	uint8_t ones = (bcd_p & 0x0f);
	
	return (tens * 10) + ones;
}


uint8_t bcd_encode_packed(uint8_t bin) {
	uint8_t tens = (bin / 10);
	uint8_t ones = bin - tens;
	
	return (tens << 4) | ones;
}<commit_msg>conv/bcd: fix ones place bug in bcd_encode_packed<commit_after>/* automaton
 * (c) 2013 <NAME>
 * The source code of this project is distributed under the terms of the
 * simplified BSD license. See the LICENSE file for details.
 */


#include "conv/bcd.h"


uint8_t bcd_decode_packed(uint8_t bcd_p) {
	uint8_t tens = (bcd_p >> 4);
	uint8_t ones = (bcd_p & 0x0f);
	
	return (tens * 10) + ones;
}


uint8_t bcd_encode_packed(uint8_t bin) {
	uint8_t tens = (bin / 10);
	uint8_t ones = (bin % 10);
	
	return (tens << 4) | ones;
}
{'fraction_non_alphanumeric': 0.12007874015748031, 'fraction_numerical': 0.04133858267716536, 'mean_word_length': 3.643835616438356, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, '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': '3896504', 'n_tokens_mistral': 443, 'n_tokens_neox': 401, 'n_words': 124}