Floating Point Extensions for the Release of Vim72

3 views
Skip to first unread message

Bill McCarthy

unread,
Aug 10, 2008, 2:05:16 AM8/10/08
to Vim Developers, Vim List
Hello Vim Developers and Users,

I've attached a patch to eval.c to extend the floating point functions
included in the new release. This patch does the same as the prior
patches I've posted for the alpha/betas. It's in unix 'fileformat' so
Windows users may need to first convert it to dos format. Place
eval.diff in your $VIMRUNTIME directory and type something like:

patch -p 0 -i eval.diff

Why the patch?

Version 7.2 includes several floating point functions but is missing
some useful ones that are part of the C library functions (and
therefore require no new code - simply references to the library).

Both log10() and pow() are present but exp(), fmod() and log() are
missing. (Although fabs() is also missing, the new abs() function
obviates the need for it.)

There are trig functions sin(), cos() and atan(). Missing are tan(),
acos(), asin() and atan2(). Also missing are the hyperbolic functions
cosh(), sinh() and tanh().

This patch adds the above missing functions. There are only 10.

BLOAT WARNING: this patch cause larger vim executables. Using
Make_ming.mak (on WinXP), vim.exe and gvim.exe are about 1.2k and 1.5k
bigger, respectively.

This patch will apply without offset warnings to 7.2. Should any
errors (other than merely offset warnings) show up in the future after
an official patch to eval.c, I'll update this patch.

--
Best regards,
Bill

eval.diff

Tony Mechelynck

unread,
Aug 10, 2008, 2:43:54 AM8/10/08
to vim...@googlegroups.com, Vim List, Bill McCarthy
On 10/08/08 08:05, Bill McCarthy wrote:
[...]

> BLOAT WARNING: this patch cause larger vim executables. Using
> Make_ming.mak (on WinXP), vim.exe and gvim.exe are about 1.2k and 1.5k
> bigger, respectively.
[...]

On Linux, my "almost full-featured" build (can work in GUI or console,
GTK2, Gnome2, Huge, with XIM, Perl, Python, Ruby and TCL but not
MzScheme, etc.) results in a 3.1 megabyte binary. I didn't build Vim 7.2
(release) without the patch for comparison, but if the difference is of
the same order of magnitude as on Windows, it is of course negligible.


Best regards,
Tony.
--
"Spare no expense to save money on this one."
-- Samuel Goldwyn

Bill McCarthy

unread,
Aug 10, 2008, 2:56:05 AM8/10/08
to Tony Mechelynck, vim...@googlegroups.com, Vim List
On Sun 10-Aug-08 1:43am -0600, you wrote:

> On 10/08/08 08:05, Bill McCarthy wrote:
> [...]
>> BLOAT WARNING: this patch cause larger vim executables. Using
>> Make_ming.mak (on WinXP), vim.exe and gvim.exe are about 1.2k and 1.5k
>> bigger, respectively.
> [...]

> On Linux, my "almost full-featured" build (can work in GUI or console,
> GTK2, Gnome2, Huge, with XIM, Perl, Python, Ruby and TCL but not
> MzScheme, etc.) results in a 3.1 megabyte binary. I didn't build Vim 7.2
> (release) without the patch for comparison, but if the difference is of
> the same order of magnitude as on Windows, it is of course negligible.

I was attempting, obviously not very successfully, to make
a little joke (in a few threads I've seen comments about
adding bloat to Vim). Perhaps I should have closed that
paragraph with a smiley :-)

--
Best regards,
Bill

Tony Mechelynck

unread,
Aug 10, 2008, 3:39:25 AM8/10/08
to Bill McCarthy, vim...@googlegroups.com, Vim List

Maybe I should have too, just for the people who didn't catch _your_
irony. I still think that it would be nice if Bram accepted this patch,
but if he won't, well, he won't. I've added it permanently to my set of
(ATM) two "unofficial" patches (the other one is a two-line config
change in feature.h to set -tag_old_static +xterm_save), even though in
fact I don't use floating-point much in Vim (when I do, it's mostly as a
"glorified calculator", by typing ":echo" statements in the running
instance of Vim).


Best regards,
Tony.
--
"The voters have spoken, the bastards ..."

Reply all
Reply to author
Forward
0 new messages