5/24/2023 0 Comments Fortran double precision![]() ![]() 128 bits reals doubles the number of digits, but it is not “hardware” (hard wired) reals.It can be interesting if I really need a greater precision. ![]() ![]() REAL(10) in gfortran is 80 bits, the computing time is 50% higher but I gain around 5 digits.but 32 bits is not interesting because I have half the precision of 64 bits with exactly the same computing time.On my PC, I can use 32 bits real, 64 bits, 80 bits, 128 bits: Now, what I am interested in is getting the best compromise between precision and speed. Moreover, you probably work in a bigger team and your code will perhaps still used by other people in 20 years, so keeping the memory of the needed precision will be helpful. Your code can run on very different architectures and selected_real_kind can surely be very useful. If you compute on supercomputers, I guess it is more complicated.And in 20 years, I don’t know what kind of CPU we will use. Although, if GPU acceleration is democratized things can become different. That kind of machine is relatively stable in time (concerning the reals in the CPU). If you work only on a PC, like myself, iso_fortran_env can probably do the job.Perhaps using iso_fortran_env or selected_real_kind depends on the kind of computer scientist you are: This is a very interesting discussion, I am learning or re-learning many things. Thank you all for your valuable answers (and “It Takes All KINDs” was so interesting and pleasant to read).
0 Comments
Leave a Reply. |