On 21/06/08 13:56, Bram Moolenaar wrote:
>
> Ben Schmidt wrote:
[...]
>> - Furthermore, on investigation, it seems there is an interesting
>>     definition of 'significant figures' in the library docs, and %.15g is
>>     the correct value, not %.16g. It might be worth noting at the printf()
>>     docs, or the Float docs where precision is mentioned, or both, that
>>     maximum precision output can be obtained with %.15g.
>
> I don't see this, for me %.16g does produce a longer result.
[...]

A higher number prints additional digits, but starting at some point, 
the additional digits are bogus. Example:

        :echo printf('%.25g', 1.0/3.0)
0.3333333333333333148296163

Anything after the row of threes is bogus.

        :echo printf('%.25g', 10.0/9.0)
1.1111111111111111604543567

Here anything after the ones is bogus. And so on. These examples seem to 
imply that, in these cases at least, %.16g is the maximum valid precision.


Best regards,
Tony.
-- 
Hartley's First Law:
        You can lead a horse to water, but if you can get him to float
on his back, you've got something.

--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---

Raspunde prin e-mail lui