From dc4fd6462ab6f59f69b20f0148adeb96646942f0 Mon Sep 17 00:00:00 2001 From: Charles Harris Date: Sat, 17 Mar 2012 23:42:13 -0600 Subject: 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. --- numpy/f2py/crackfortran.py | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'numpy/f2py') 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={}): -- cgit v1.2.1