On Tue, Apr 08, 2008 at 09:47:50PM -0400, David Fishburn wrote: >> The main problem with floating point is that the usual notation already >> has a meaning: >> >> echo 123.456 >> 123456 >> >> That is because "." is the concatenation operator, and numbers are >> automatically converted to strings. >> >> I considered a few alternatives: >> >> 123,456 used for function arguments >> float("123,456") too verbose >> #123.456 has a meaning after == and != >> $123.456 confusion with $ENV >> >> The best I could think of was &123.456. It's a bit obscure, you need to >> get used to it. But it works. >> >> echo &123.456e-3 >> 0.123456 >> >> Feel free to suggest something better, but make sure it doesn't already >> mean something in any context in Vim script. > > Why not leave it as specifying e on the end of any floating point number. > > 123.456e-3 > 123.456e+0 > > And so on? That would prevent any confusion, unless of course that is > already used.
Already used: :let e=1 :echo 1.23e+0 123 1 I made the same mistake :) GI -- Shotgun wedding: A case of wife or death. --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---