howerj / q

A fixed point library (Signed Q16.16) for embedded systems.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

itoch

EuanKirkhope opened this issue · comments

commented

Looks like there's an error in itoch:

static char itoch(const unsigned ch) {
	assert(ch < 36);
	if (ch <= 9)
		return ch + '0';
	return ch + 'A';
}

should it not be:

static char itoch(const unsigned ch) {
	assert(ch < 36);
	if (ch <= 9)
		return ch + '0';
	return ch + 'A' - 10;    // -10
}
commented

That's correct, I've pushed a fix for that (and a facility to allow base changes during unit tests). Thanks for that!