ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/libecb/ecb.h
(Generate patch)

Comparing libecb/ecb.h (file contents):
Revision 1.196 by sf-exg, Sun Jun 27 15:55:25 2021 UTC vs.
Revision 1.197 by root, Sat Jul 31 14:39:16 2021 UTC

951/* fast integer to ascii */ 951/* fast integer to ascii */
952 952
953/* 953/*
954 * This code is pretty complicated because it is general. The idea behind it, 954 * This code is pretty complicated because it is general. The idea behind it,
955 * however, is pretty simple: first, the number is multiplied with a scaling 955 * however, is pretty simple: first, the number is multiplied with a scaling
956 * factor (2**bits / 10**(digits-1)) to convert nthe integer into a fixed-point 956 * factor (2**bits / 10**(digits-1)) to convert the integer into a fixed-point
957 * number with the first digit in the upper bits. 957 * number with the first digit in the upper bits.
958 * Then this digit is converted to text and masked out. The resulting number 958 * Then this digit is converted to text and masked out. The resulting number
959 * is then multiplied by 10, by multiplying the fixed point representation 959 * is then multiplied by 10, by multiplying the fixed point representation
960 * by 5 and shifting the (binary) decimal point one to the right, so a 4.28 960 * by 5 and shifting the (binary) decimal point one to the right, so a 4.28
961 * format becomes 5.27, 6.26 and so on. 961 * format becomes 5.27, 6.26 and so on.

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines