Single precision floating point calcs?

Beliavsky beliavsky at aol.com
Thu May 10 12:56:31 EDT 2007


Off-topic, but maybe as practical as "[making] your own Python build
from altered source." ---

Fortran 95 (and earlier versions) has single and double precision
floats. One could write a Fortran code with variables declared REAL,
and compilers will by default treat the REALs as single precision, but
most compilers have an option to promote single precision variables to
double. In Fortran 90+ one can specify the KIND of a REAL, so if
variables as

REAL (kind=rp) :: x,y,z

throughout the code with rp being a global parameter, and one can
switch from single to double by changing rp from 4 to 8. G95 is a
good, free compiler. F95 has most but not all of the array operations
of NumPy.




More information about the Python-list mailing list