How Do I Determine Single-Precision Machine Constants in Fortran?

Click For Summary
SUMMARY

The discussion focuses on determining the Single-Precision Machine Constants in Fortran for a specific Intel Pentium Dual Core 5200 system running Windows Vista. The constants in question are defined as R1MACH(1) through R1MACH(5), which represent the smallest positive magnitude, largest magnitude, smallest relative spacing, largest relative spacing, and logarithm base 10 of the base, respectively. The constants are calculated using specific formulas involving the base (B), minimum exponent (EMIN), maximum exponent (EMAX), and precision (T). The reference provided is from the ACM Transactions on Mathematical Software, which outlines a framework for a portable library.

PREREQUISITES
  • Understanding of Fortran programming language
  • Familiarity with floating-point representation and machine constants
  • Knowledge of numerical methods and their implementation in Fortran
  • Basic understanding of logarithmic functions
NEXT STEPS
  • Research the Fortran intrinsic functions related to floating-point arithmetic
  • Learn how to implement R1MACH calculations in Fortran
  • Explore the IEEE 754 standard for floating-point computation
  • Study the ACM Transactions on Mathematical Software for insights on portable libraries
USEFUL FOR

This discussion is beneficial for Fortran developers, numerical analysts, and anyone involved in scientific computing who needs to understand machine constants and their implications in numerical methods.

cslam
Messages
1
Reaction score
0
Help!
I know almost nothing about Fortran but need to use a program by others. I encountered a problem in determining the "Single-Precision Machine Constants" for my desktop computer (intel pentium dual core 5200 2mb l2 2.5ghz 800 fsb with Window Vista). Please take a look at following part or comment in the code. Could anyone help me to determne R1MACH(1 to 5)?

C Single-Precision Machine Constants r1mach27
C R1MACH(1) = B**(EMIN-1), the smallest positive magnitude. r1mach28
C R1MACH(2) = B**EMAX*(1 - B**(-T)), the largest magnitude. r1mach29
C R1MACH(3) = B**(-T), the smallest relative spacing. r1mach30
C R1MACH(4) = B**(1-T), the largest relative spacing. r1mach31
C R1MACH(5) = LOG10(B) r1mach32
C***REFERENCES FOX, P.A., HALL, A.D., SCHRYER, N.L, *FRAMEWORK FOR r1mach33
C A PORTABLE LIBRARY*, ACM TRANSACTIONS ON MATHE- r1mach34
C MATICAL SOFTWARE, VOL. 4, NO. 2, JUNE 1978, r1mach35
C PP. 177-188. r1mach36
 
Technology news on Phys.org

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K