Mercurial > vim
comparison src/eval.c @ 2441:620a42739426 vim73
Improvements for VMS. (Zoltan Arpadffy)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Fri, 30 Jul 2010 22:29:41 +0200 |
parents | 2533a507001f |
children | a88237afdb20 |
comparison
equal
deleted
inserted
replaced
2440:fc695854c33a | 2441:620a42739426 |
---|---|
4800 { | 4800 { |
4801 if (op == '*') | 4801 if (op == '*') |
4802 f1 = f1 * f2; | 4802 f1 = f1 * f2; |
4803 else if (op == '/') | 4803 else if (op == '/') |
4804 { | 4804 { |
4805 # ifdef VMS | |
4806 /* VMS crashes on divide by zero, work around it */ | |
4807 if (f2 == 0.0) | |
4808 { | |
4809 if (f1 == 0) | |
4810 f1 = -0x7fffffffL - 1L; /* similar to NaN */ | |
4811 else if (f1 < 0) | |
4812 f1 = -0x7fffffffL; | |
4813 else | |
4814 f1 = 0x7fffffffL; | |
4815 } | |
4816 else | |
4817 f1 = f1 / f2; | |
4818 # else | |
4805 /* We rely on the floating point library to handle divide | 4819 /* We rely on the floating point library to handle divide |
4806 * by zero to result in "inf" and not a crash. */ | 4820 * by zero to result in "inf" and not a crash. */ |
4807 f1 = f1 / f2; | 4821 f1 = f1 / f2; |
4822 # endif | |
4808 } | 4823 } |
4809 else | 4824 else |
4810 { | 4825 { |
4811 EMSG(_("E804: Cannot use '%' with Float")); | 4826 EMSG(_("E804: Cannot use '%' with Float")); |
4812 return FAIL; | 4827 return FAIL; |