I'm trying to study chaos theory (Butterfly effect? - smallest initial condition can have adverse effects on the outcome). I book I'm following has code in Fortran, I've been assigned by my professor to try and implement the program i开发者_Go百科n C++, however I can't seem to replicate the results, and so I was wondering:
What is the size of a type double in Fortran?
Thanks
If by "type double" you mean what used to go by the name of "double precision", then - it depends. It was commonly double of what single represented, but that also varied with your environment (the implementation of the processor).
Nowadays, (>F90 I think) those problems are usually avoided by explicitly stating a custom data type, by stating your requirements in regards of precision and data range. Check out functions SELECTED_REAL_KIND (and the links in the help from this one onward).
In short, you define a kind type, for a given range/precision.
精彩评论