- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Is there a way of specifying numerical data using a G type descriptor that behaves like ES or EN when the exponential format is required. Currently I believe only the standard E format is used with G specifiers.
eg -12345.678 in E13.6 format -0.123456E+05
ES13.6 format -1.234567E+04
EN13.6 format -12.34567E+03
The ES and EN formats give you an extra significant figure and are easier to read. Using the G format has the advantage of writing numbers in floating point format where possible which are even easier to read. A GS (& GN) format would provide a flexible and neat way of writing a large range of numbers fully utilising the space available.
- Balises:
- Intel® Fortran Compiler
Lien copié
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
Is there a way of specifying numerical data using a G type descriptor that behaves like ES or EN when the exponential format is required. Currently I believe only the standard E format is used with G specifiers.
p edit descriptors may be ugly in some cases, but this is the first time I've seen a claim not to believe in them.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
As Tim hints, adding 1P (or 2P or whatever) before the G edit descriptor gives you control of the number of digits to the left of the radix point. There is no S or N form of G. You will want to make sure that you reset to 0P before using any F edit descriptors.
- Marquer comme nouveau
- Marquer
- S'abonner
- Sourdine
- S'abonner au fil RSS
- Surligner
- Imprimer
- Signaler un contenu inapproprié
As Tim hints, adding 1P (or 2P or whatever) before the G edit descriptor gives you control of the number of digits to the left of the radix point. There is no S or N form of G. You will want to make sure that you reset to 0P before using any F edit descriptors.
Thank Steve, but using the P edit descriptor with G does not do what I requested. I tried it 1PG13.5 for 55.0 example gives a formatted string of 55.00000E+00 not 55.00000. I can get round by coding but the reason for this post was primarily to suggest that the GN and GS format descriptors would be nice to have as part of the language.

- S'abonner au fil RSS
- Marquer le sujet comme nouveau
- Marquer le sujet comme lu
- Placer ce Sujet en tête de liste pour l'utilisateur actuel
- Marquer
- S'abonner
- Page imprimable