I've written a program that repeats a calculation a certain number of times in single precision, then in double precision. The times are recorded by the cpu_time(real t1) subroutine. (Specifically, the calculation is aReal/(aReal+0.01) .) It seems that the time for the double calculation is 1.20 times the time for the single precision calculation. (There was little difference in the times for ~1 second times, but over many minutes there's a clear 1.2 factor.) Why isn't it larger than that? (Not that I'm complaining.) I'd figure that for addition and subtraction, dealing with double variables would take twice as long, and it would be four times as long for multiplication (and somewhere around there for division).(adsbygoogle = window.adsbygoogle || []).push({});

**Physics Forums - The Fusion of Science and Community**

Dismiss Notice

Join Physics Forums Today!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

# Double precision computation time in fortran

Loading...

Similar Threads - Double precision computation | Date |
---|---|

Java Minesweeper JFrame Flicker | Aug 12, 2017 |

C/++/# Precision double in C/C++? | Oct 25, 2016 |

Fortran Modern variable precision and integer multipliers | Mar 16, 2016 |

Real vs. double precision in Fortran 90? | Aug 1, 2011 |

How to get first digit of a double precision number? | Nov 1, 2009 |

**Physics Forums - The Fusion of Science and Community**