I believe that formatting types e/E, f/F and g/G will all handle float, double and long double without casts.
Example CELEBF30 available in the Runtime Library Reference under: Library Functions fprintf(), printf() and sprint() - Format and write data Shows a float printed with g and G specifiers with no cast. HTH Peter -----Original Message----- From: IBM Mainframe Discussion List [mailto:[email protected]] On Behalf Of Paul Gilmartin Sent: Monday, March 13, 2017 7:03 PM To: [email protected] Subject: Re: C fprintf() format code for 32-bit float? On Mon, 13 Mar 2017 15:53:20 -0700, Charles Mills wrote: >Apologies for the basic question. About everything I know about >floating point could be engraved on the back of a postage stamp. > >For C fprintf() and friends, how do I specify the formatting of a >32-bit floating point number (C type "float" as opposed to "double))? >e, f or g with some modifier? > Can you cast to (double)? -- This message and any attachments are intended only for the use of the addressee and may contain information that is privileged and confidential. If the reader of the message is not the intended recipient or an authorized representative of the intended recipient, you are hereby notified that any dissemination of this communication is strictly prohibited. If you have received this communication in error, please notify us immediately by e-mail and delete the message and any attachments from your system. ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN
