Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Float limits checking code belongs in the computer museum #4455

Open
larsmans opened this issue Jan 22, 2015 · 4 comments
Open

Float limits checking code belongs in the computer museum #4455

larsmans opened this issue Jan 22, 2015 · 4 comments
Labels
enhancement A new feature or improvement maintenance Items related to regular maintenance tasks

Comments

@larsmans
Copy link
Contributor

scipy.integrate and scipy.special both have modules d1mach.f and r1mach.f that check whether they're running on Cray, Convex, IBM and VAX machines that probable no-one has ever ported SciPy to. The code can be easily trimmed down to handle IEEE floats only, but it would be even better (IMHO) to rewrite these modules in a few lines of C; the relevant values are macros in <float.h> and the C code is actually given in comments. I would do this myself if I knew who to call C from Fortran.

@pv pv added enhancement A new feature or improvement maintenance Items related to regular maintenance tasks labels Jan 25, 2015
@pv
Copy link
Member

pv commented Jan 25, 2015

Calling C from Fortran77: http://hpc.ucla.edu/hoffman2/software/c-fortran-interop.php
It's not possible to write Fortran77-compatible FUNCTIONs in C, only SUBROUTINEs work reasonably portably, so the d1mach.f and r1mach.f files cannot be completely removed, just the contents of the functions replaced.
(But this is probably a fairly low-priority maintenance problem in any case.)

@ev-br
Copy link
Member

ev-br commented Jan 25, 2015

Might be easier to use compiler intrinsics, which are available in Fortran 90 and above (huge, tiny, spacing).
(Assuming that we'll be able to move on from f77 at some point, that is.)

@pv
Copy link
Member

pv commented Jan 25, 2015

Yet easier would be to leave it as it is, since it's apparently not really broken.

@larsmans
Copy link
Contributor Author

It's not broken, it's just taking up space/compile time. Wasn't there some discussion about moving to a more modern Fortran some time ago?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement A new feature or improvement maintenance Items related to regular maintenance tasks
Projects
None yet
Development

No branches or pull requests

3 participants