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

  • Home
  • SEARCH
  • 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 8461267
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:49:59+00:00 2026-06-10T13:49:59+00:00

I saw a calendar program written in C which just says 100. instead of

  • 0

I saw a calendar program written in C which just says 100. instead of 100.00. The program compiled without any issues.

My question is how is this legal. Shouldnt the C compiler not complain that there are no decimals after the .?

Advance thanks for your answers!

  • 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-06-10T13:50:00+00:00Added an answer on June 10, 2026 at 1:50 pm

    Because section 6.4.4.2 of the language standard, “Floating constants” , defines them thusly:

    floating-constant:
        decimal-floating-constant
        hexadecimal-floating-constant
    
    decimal-floating-constant:
        fractional-constant exponent-part(opt) floating-suffix(opt)
        digit-sequence exponent-part floating-suffix(opt)
    
    hexadecimal-floating-constant:
        hexadecimal-prefix hexadecimal-fractional-constant
        binary-exponent-part floating-suffixopt
        hexadecimal-prefix hexadecimal-digit-sequence
        binary-exponent-part floating-suffix(opt)
    
    fractional-constant:
        digit-sequence(opt) . digit-sequence
        digit-sequence .
    
    exponent-part:
        e sign(opt) digit-sequence
        E sign(opt) digit-sequence
    
    sign: one of
        + -
    
    digit-sequence:
        digit
        digit-sequence digit
    
    hexadecimal-fractional-constant:
        hexadecimal-digit-sequence(opt) .
        hexadecimal-digit-sequence
        hexadecimal-digit-sequence .
    
    binary-exponent-part:
        p sign(opt) digit-sequence
        P sign(opt) digit-sequence
    
    hexadecimal-digit-sequence:
        hexadecimal-digit
        hexadecimal-digit-sequence hexadecimal-digit
    
    floating-suffix: one of
        f l F L
    

    Bottom line, all of the following would be valid floating point literals meaning “zero”:

    0.

    .0

    0.0

    (Your “100.” would be a valid floating-constant, as it is a decimal-floating-constant consisting of a fractional-constant (omitting the optional exponent-part and floating-suffix); it is a digit-sequence followed by a period, which is valid for a fractional-constant as by the second line of that noteable’s definition.)

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

Sidebar

Related Questions

Saw this question recently: Given 2 arrays, the 2nd array containing some of the
I saw this aricle which describes implementing the IHttpAsyncHandler . Looking at this part:
Saw this. Why the explicit cast to IDisposable? Is this just a shorthand to
I saw this in an answer to another question , in reference to shortcomings
I saw this link (http://stackoverflow.com/questions/6603868/android-onclicklistener-and-table-layout) which seems like it works for the person asking
I've seen this question before but all the answers I saw do not apply
I saw many threads with this tittle, but no one really speak about reuse
I saw some html that displays the results of a PHP code just by
I saw a similar question being posted here, yet it did not help me
I saw this: $(div).children().andSelf().contents().each(function(){ if (this.nodeType == 3) { var $this = $(this); $this.replaceWith($this.text().replace(/(\w)/g,

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.