On Sun 30-Nov-08 6:20pm -0600, Tony Mechelynck wrote:
> Slightly (but not wholly) OT: Bill, I know that your extra float
> functions' help has of course long since been erased by syncing with the
> "official" doc/eval.txt. Maybe it would be worth while to publish it
> separately, and with a different filename, as something which could be
> dropped into $VIM/vimfiles/doc/ in order to avoid conflicts in the future.
A first pass at this is attached, saved after "set ff=unix".
--
Best regards,
Bill
--~--~---------~--~----~------------~-------~--~----~
You received this message from the "vim_dev" maillist.
For more information, visit http://www.vim.org/maillist.php
-~----------~----~----~----~------~----~------~--~---
*float-ext.txt* For Vim Version 7.2. Last change: 2008 Nov 30
A description of the 10 functions added to the floating point support. This
is for the extention provided by Bill McCarthy.
acos({expr}) *acos()*
Return the arc cosine of {expr} measured in radians, as a
|Float|in the range of [0,pi].
{expr} must evaluate to a|Float|or a|Number|in [-1,1].
Examples: >
:echo acos(0)
< 1.570796 >
:echo acos(-0.5)
< 2.094395
{only available when compiled with|+float|and extention}
asin({expr}) *asin()*
Return the arc sine of {expr} measured in radians, as a|Float|
in the range of [-pi/2,pi/2].
{expr} must evaluate to a|Float|or a|Number|in [-1,1].
Examples: >
:echo asin(0.8)
< 0.927295 >
:echo asin(-0.5)
< -0.523599
{only available when compiled with|+float|and extention}
atan2({expr1},{expr2}) *atan2()*
Return the arc tangent of {expr1}/{expr2}, measured in radians,
as a|Float|in the range [-pi,pi].
{expr1} and {expr2} must evaluate to a|Float|or a|Number|.
Examples: >
:echo atan2(-1,1)
< -0.785398 >
:echo atan2(1,-1)
< 2.356194
{only available when compiled with|+float|and extention}
cosh({expr}) *cosh()*
Return the hyperbolic cosine of {expr} as a|Float|in [1,inf].
{expr} must evaluate to a|Float|or a|Number|.
Examples: >
:echo cosh(0.5)
< 1.127626 >
:echo cosh(-0.5)
< -1.127626
{only available when compiled with|+float|and extention}
exp({expr}) *exp()*
Return the exponential of {expr} as a|Float|in [0,inf].
{expr} must evaluate to a|Float|or a|Number|.
Examples: >
:echo exp(2)
< 7.389056 >
:echo exp(-1)
< 0.367879
{only available when compiled with|+float|and extention}
fmod({expr1},{expr2}) *fmod()*
Return the remainder of {expr1}/{expr2}, even if the division
is not representable. Returns {expr1} - i * {expr2} for some
integer i such that if {expr2} is non-zero, the result has the
same sign as {expr1} and magnitude less than the magnitude of
{expr2}. If {expr2} is zero, the value returned is zero. The
value returned is a|Float|.
{expr1} and {expr2} must evaluate to a|Float|or a|Number|.
Examples: >
:echo fmod(12.33,1.22)
< 0.13 >
:echo fmod(-12.33,1.22)
< -0.13
{only available when compiled with|+float|and extention}
log({expr}) *log()*
Return the natural logarithm (base e) of {expr} as a|Float|.
{expr} must evaluate to a|Float|or a|Number|in (0,inf].
Examples: >
:echo log(10)
< 2.302585 >
:echo log(exp(5))
< 5.0
{only available when compiled with|+float|and extention}
sinh({expr}) *sinh()*
Return the hyperbolic sine of {expr} as a|Float|in [-inf,inf].
{expr} must evaluate to a|Float|or a|Number|.
Examples: >
:echo sinh(0.5)
< 0.521095 >
:echo sinh(-0.9)
< -1.026517
{only available when compiled with|+float|and extention}
tan({expr}) *tan()*
Return the tangent of {expr}, measured in radians, as a|Float|
in the range [-inf,inf].
{expr} must evaluate to a|Float|or a|Number|.
Examples: >
:echo tan(10)
< 0.648361 >
:echo tan(-4.01)
< -1.181502
{only available when compiled with|+float|and extention}
tanh({expr}) *tanh()*
Return the hyperbolic tangent of {expr} as a|Float|in [-1,1].
{expr} must evaluate to a|Float|or a|Number|.
Examples: >
:echo tanh(0.5)
< 0.462117 >
:echo tanh(-1)
< -0.761594
{only available when compiled with|+float|and extention}
vim:tw=78:ts=8:ft=help:norl: