Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6354763
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T22:37:56+00:00 2026-05-24T22:37:56+00:00

I’d like to know the size of a float in GCC, without having to

  • 0

I’d like to know the size of a float in GCC, without having to run the compiler. I know one option is to write a small function and have the compiler print out an assembly listing.

There is limits.h, which contains the minimums and maximums, but is there something similar that tells the size of the different implicit types?

I’m using GCC on Windows 7 x64; the target platform is ARM7 32 bit mode. Language is C.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-24T22:37:56+00:00Added an answer on May 24, 2026 at 10:37 pm

    You can have GCC print out all of the default macros:

    gcc -dM -E - </dev/null | grep FLT
    

    Then you get lines like:

    #define __FLT_MANT_DIG__ 24
    #define __FLT_MAX_EXP__ 128
    

    Now you can parse this as follows:

    24 + lg(128) + 1 = 32
    

    To find documentation:

    1) man gcc:

       -E  Stop after the preprocessing stage; do not run the compiler proper.
           The output is in the form of preprocessed source code, which is
           sent to the standard output.
    
    ...
    
       -dCHARS
           CHARS is a sequence of one or more of the following characters, and
           must not be preceded by a space.  Other characters are interpreted
           by the compiler proper, or reserved for future versions of GCC, and
           so are silently ignored.  If you specify characters whose behavior
           conflicts, the result is undefined.
    
           M   Instead of the normal output, generate a list of #define
               directives for all the macros defined during the execution of
               the preprocessor, including predefined macros.  This gives you
               a way of finding out what is predefined in your version of the
               preprocessor.  Assuming you have no file foo.h, the command
    
                       touch foo.h; cpp -dM foo.h
    
               will show all the predefined macros.
    

    2) the actual macros:

    http://www.gnu.org/s/hello/manual/libc/Floating-Point-Parameters.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I would like to run a str_replace or preg_replace which looks for certain words
I would like to count the length of a string with PHP. The string
For some reason, after submitting a string like this Jack’s Spindle from a text
I used javascript for loading a picture on my website depending on which small
I've got a string that has curly quotes in it. I'd like to replace
I am reading a book about Javascript and jQuery and using one of the
I am trying to render a haml file in a javascript response like so:
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.