Ben Schmidt wrote:

> With a small amount of testing, it's looking good, Bram. Tests says "ALL
> DONE" which I presume means they all passed.
> 
> A few points:
> 
> - Wouldn't float2nr() be more consistent with the other Vim functions
>    than float2number()? O yes! So much so that it seems that's what you
>    implemented it as. It's wrongly documented, though.
> 
> - The floor() function seems to be documented twice.
> 
> - pow() isn't documented at all--works nicely, though! trunc() ditto.
> 
> - The functions are not in correct alphabetical order in the docs.

You are apparently looking at slightly outdated runtime files.  I'll
push the current version now, so that they match with the latest
floating point patch.

> - The neater display is nice. IMHO it would be better to show full
>    precision when this is there. I.e. it's great that :echo 2.7 shows
>    just 2.7. But it'd be great if :echo 2.718281828459045 showed that,
>    rather than just 2.718282. I guess this depends on printf, and so may
>    not be possible (I can't get it to work in Vim at present, doing %.16g
>    and %g loses it's nice truncation of zeros property), but it would be
>    nicer, I think, if it is easily possible.

printf() uses a default precision of 6.  I think it's OK for a default,
showing more is mostly not useful.

> - No chance of getting sin(), cos(), atan() and log10()? I realised
>    after thinking a bit further and reading some other users' posts that
>    these actually would truly be useful. Surely they would only take a
>    few minutes to implement, no time to maintain, and I would have a lot
>    of use for them. I don't know how many users are like me, but there
>    must be a few as surely programming is fairly closely related to
>    mathematics in many ways. (I'd like exp() and log() as well, but these
>    can be done with pow() and log10() by appropriately defining e, so not
>    an issue. tan(), sgn(), rand(), etc. are easy with scripts, too, so no
>    problems there.)

log10() is there.  I don't see a use for sin() and the like.  If you
really want these please come up with an example.

> - Actually, though, an abs() function may be worth implementing, the
>    reason being that with floats you often need to compare with a given
>    precision to make it work. Since often computations will result in
>    slightly different numbers, the == operator is not adequate, and you
>    need to do something like abs(a-b) < 1.0e-9 as a kind of
>    'approximately equal to' instead.

It's useful.  I suppose we can make it work for both Float and Number,
without changing the return type.

> Note that I'm using runtime files from the ftp server (via aap). So if
> the patch does anything to them, it's not taking effect, because I'm
> replacing runtime files with aap; that may explain some of my
> documentation comments, I guess.

Should work now.

-- 
Be thankful to be in a traffic jam, because it means you own a car.

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://ICCF-Holland.org    ///

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

Reply via email to