summaryrefslogtreecommitdiff
path: root/numpy/f2py/crackfortran.py
diff options
context:
space:
mode:
authorCharles Harris <charlesr.harris@gmail.com>2012-03-17 23:42:13 -0600
committerCharles Harris <charlesr.harris@gmail.com>2012-03-17 23:42:13 -0600
commitdc4fd6462ab6f59f69b20f0148adeb96646942f0 (patch)
tree1a6e0f1d763e9c4024a4aa27a65e764fec049a52 /numpy/f2py/crackfortran.py
parent32a4a7d282c4cdbbfdf09ff10345e05ccec58919 (diff)
downloadnumpy-dc4fd6462ab6f59f69b20f0148adeb96646942f0.tar.gz
BUG: Fix f2py test_kind.py test.
Newer Fortran compilers for Intel may support quad precision, so _selected_real_kind_func needs to report that for precisions >= 19.
Diffstat (limited to 'numpy/f2py/crackfortran.py')
-rwxr-xr-xnumpy/f2py/crackfortran.py13
1 files changed, 8 insertions, 5 deletions
diff --git a/numpy/f2py/crackfortran.py b/numpy/f2py/crackfortran.py
index d02b1f077..5d664e399 100755
--- a/numpy/f2py/crackfortran.py
+++ b/numpy/f2py/crackfortran.py
@@ -1977,16 +1977,19 @@ def _selected_int_kind_func(r):
if m<=2**128: return 16
return -1
-def _selected_real_kind_func(p,r=0,radix=0):
+def _selected_real_kind_func(p, r=0, radix=0):
#XXX: This should be processor dependent
- if p<7: return 4
- if p<16: return 8
+ # This is only good for 0 <= p <= 20
+ if p < 7: return 4
+ if p < 16: return 8
if platform.machine().lower().startswith('power'):
- if p<=20:
+ if p <= 20:
return 16
else:
- if p<19:
+ if p < 19:
return 10
+ elif p <= 20:
+ return 16
return -1
def get_parameters(vars, global_params={}):