John Beckett wrote:
> Bram Moolenaar wrote:
> > Here is an update for the floating point patch.
>
> I've done a bit more testing with the latest floating point patch.
> Vim's floating point doesn't need to cover all extremes, but the
> following shows some bad results.
>
> :help floating-point-format (in eval.txt)
> It says you can have negative number: &-0.123
> :let a = &-0.123
> Result: E112: Option name missing: &-0.123
> :let a = -&0.123
> This works but is inelegant.
I'll fix that.
> str2float('1.75') works by converting '1' to 1 and '75' to 75, then
> combining them (1 + 75/10^2). That gives a couple of problems. First,
> should probably document that a 32-bit machine won't keep 15 digits of
> precision in something like str2float('0.123456789012345').
>
> Second, the lhs and rhs of the '.' can each overflow an integer, giving chaos.
> :let a=str2float('0.3111222333')
> :echo a
> Result: -0.118374
How do you suggest to fix this?
> In the next example, Vim calculates (-1 + 0.75).
> :let a=str2float('-1.75')
> :echo a
> Result: -0.250000
I'll fix that.
> Typo in eval.c ("sting" --> "string"):
> Convert the sting "text" to a floating point number.
I'll fix that.
--
You were lucky to have a LAKE! There were a hundred and sixty of
us living in a small shoebox in the middle of the road.
/// 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
-~----------~----~----~----~------~----~------~--~---