Bram Moolenaar wrote:
>> 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?I still think that using strtod() would be best, but curiosity got the better of me and I have produced the attached alternative. I've given it a reasonable test, but I haven't bothered fully studying it because you might want to do it another way. This patch applies to Vim 7.1 with patches 1-293 and Bram's last floating point patch (2008-04-13). It fixes all the problems I mentioned. John --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
float-jb.diff
Description: Binary data
