[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: RE: [ANNOUNCE] Lua 5.0 (alpha) now available
- From: Luiz Henrique de Figueiredo <lhf@...>
- Date: Mon, 19 Aug 2002 08:36:33 -0300
>If you look at the source for most
>*printf implementations, you'll see that only a tiny fraction of it is
>concerned with converting numbers to strings.
Not so. Most systems derived from BSD include David Gay's dtoa, which is huge
(but does exactly what we want, which is being able to real numbers convert
from and to strings without losing precision, so that the *exact* number can be
reproduced; this is very difficult to get right in all cases).
Another reason for including our own very tiny printf is that it uses Lua
strings and hence does not suffer from buffer-size limitations in sprintf,
which had forced us to write lots of %.99s format specifiers and use many local
buffers of arbitrary length. The code is much cleaner now, and probably smaller
as a whole. Moreover, we were able to export this to the API as a service.
--lhf