Mercurial > vim
comparison src/eval.c @ 2529:2aaa88366cbb vim73
Fix for float values on VMS. (Zoltan Arpadffy)
author | Bram Moolenaar <bram@vim.org> |
---|---|
date | Mon, 09 Aug 2010 22:07:08 +0200 |
parents | a88237afdb20 |
children | 9fe4164cb586 |
comparison
equal
deleted
inserted
replaced
2528:8bc2e8390c11 | 2529:2aaa88366cbb |
---|---|
18 | 18 |
19 #if defined(FEAT_EVAL) || defined(PROTO) | 19 #if defined(FEAT_EVAL) || defined(PROTO) |
20 | 20 |
21 #ifdef AMIGA | 21 #ifdef AMIGA |
22 # include <time.h> /* for strftime() */ | 22 # include <time.h> /* for strftime() */ |
23 #endif | |
24 | |
25 #ifdef VMS | |
26 # include <float.h> | |
23 #endif | 27 #endif |
24 | 28 |
25 #ifdef MACOS | 29 #ifdef MACOS |
26 # include <time.h> /* for time_t */ | 30 # include <time.h> /* for time_t */ |
27 #endif | 31 #endif |
4805 # ifdef VMS | 4809 # ifdef VMS |
4806 /* VMS crashes on divide by zero, work around it */ | 4810 /* VMS crashes on divide by zero, work around it */ |
4807 if (f2 == 0.0) | 4811 if (f2 == 0.0) |
4808 { | 4812 { |
4809 if (f1 == 0) | 4813 if (f1 == 0) |
4810 f1 = -0x7fffffffL - 1L; /* similar to NaN */ | 4814 f1 = -1 * __F_FLT_MAX - 1L; /* similar to NaN */ |
4811 else if (f1 < 0) | 4815 else if (f1 < 0) |
4812 f1 = -0x7fffffffL; | 4816 f1 = -1 * __F_FLT_MAX; |
4813 else | 4817 else |
4814 f1 = 0x7fffffffL; | 4818 f1 = __F_FLT_MAX; |
4815 } | 4819 } |
4816 else | 4820 else |
4817 f1 = f1 / f2; | 4821 f1 = f1 / f2; |
4818 # else | 4822 # else |
4819 /* We rely on the floating point library to handle divide | 4823 /* We rely on the floating point library to handle divide |