On Mon 23-Jun-08 11:19am -0600, Ben Schmidt wrote: You gave the following example from my missing email:
> :" Inaccurate due to underflow > :echo PG(1.0e-323) > 9.88131291682e-324 > :" Negative zero incorrect > :echo PG(-0.0) > 0 > :" Too many digits > :echo PG(999999999999.5) > 1000000000000 You then described a new 150 line alternative which gave these results: > :echo PrintFloat(1.0e-323) > 0.1e-322 > :echo PrintFloat(-0.0) > -0.0 > :echo PrintFloat(999999999999.5) > 1.0e12 I made a small change to my PG() function so it no longer relies on log10(). It appears to work quite well. Nonetheless, two of your three examples don't work on my machine. 1.0e-323 is below DBL_MIN and evaluates to zero. Typing echo 1.0e-323 yields 0.0. However: :echo PG(2.225074e-308) 2.225074e-308 :echo PG(2.225073e-308) 0 Your compiler's print utilities are apparently using denormalized doubles. Please let me know if the new PG() produces strange results for 1.0e-323. In Vim, I can't seem to get a -0.0 result. Likewise, :echo PG(-0.0) 0 Now that I no longer using log10 to determine magnitudes: :echo PG(999999999999.5) 1e+12 :echo PG(99999999999.5) 99,999,999,999.5 The updated version of PG.vim is attached. Hopefully it will post this time :-) I plan to spend some time with your attachment this weekend. -- Best regards, Bill --~--~---------~--~----~------------~-------~--~----~ You received this message from the "vim_dev" maillist. For more information, visit http://www.vim.org/maillist.php -~----------~----~----~----~------~----~------~--~---
PG.vim
Description: Binary data