Ben Schmidt wrote: > - 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.) > > - 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.
I agree entirely. Once you have floating point, you should have the standard functions that the vast majority of programming languages that support floating point arithmetic have. Vim now has essentially all of the functionality of grep and sed built in. Adding the standard math library would give Vim most of the functionality of awk that is currently missing in Vim. Ajit --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---