Implements Intop-Log10.
Intop-Log10 impl | Implements Intop-Log10. |
Copyright | This program is free software. |
Files | |
C-kern/ | Header file Intop-Log10. |
C-kern/ | Implementation file Intop-Log10 impl. |
int_t | |
local variables | |
s_pow10 | Contains powers of 10 (10ⁿ). |
compute | |
log10_int32 | Uses s_pow10 table to decrement result if necessary. |
log10_int64 | Uses s_pow10 table to decrement result if necessary. |
test |
This program is free software. You can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
© 2012 Jörg Seebohn
Header file Intop-Log10.
Implementation file Intop-Log10 impl.
local variables | |
s_pow10 | Contains powers of 10 (10ⁿ). |
compute | |
log10_int32 | Uses s_pow10 table to decrement result if necessary. |
log10_int64 | Uses s_pow10 table to decrement result if necessary. |
test |
unsigned log10_int32( uint32_t i )
Uses s_pow10 table to decrement result if necessary.
unsigned log10_int64( uint64_t i )
Uses s_pow10 table to decrement result if necessary.
Contains powers of 10 (10ⁿ).
static uint64_t s_pow10[20]
Uses s_pow10 table to decrement result if necessary.
unsigned log10_int32( uint32_t i )
Uses s_pow10 table to decrement result if necessary.
unsigned log10_int64( uint64_t i )