0
0
mirror of https://github.com/vim/vim.git synced 2025-09-27 04:14:06 -04:00

Improvements for VMS. (Zoltan Arpadffy)

This commit is contained in:
Bram Moolenaar
2010-07-30 22:29:41 +02:00
parent 68392724b8
commit f878bcfb2e
3 changed files with 84 additions and 26 deletions

View File

@@ -4802,9 +4802,24 @@ eval6(arg, rettv, evaluate, want_string)
f1 = f1 * f2;
else if (op == '/')
{
# ifdef VMS
/* VMS crashes on divide by zero, work around it */
if (f2 == 0.0)
{
if (f1 == 0)
f1 = -0x7fffffffL - 1L; /* similar to NaN */
else if (f1 < 0)
f1 = -0x7fffffffL;
else
f1 = 0x7fffffffL;
}
else
f1 = f1 / f2;
# else
/* We rely on the floating point library to handle divide
* by zero to result in "inf" and not a crash. */
f1 = f1 / f2;
# endif
}
else
{