ArticleslgStudy

science

C99

C99 is a science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand C99 rather than just read about it. In short: C99 (C9X during its development, formally ISO/IEC 9899:1999) is a past version of the C programming language open standard. It extends the previous version (C90) with new features for the language and the standard library, and helps implementations make better use of available computer hardware, such as IEEE 754-1985 floating-point arithmetic, and compiler technology.

C99 — main illustration
C99 — illustration

Key takeaways

  • C99 belongs to science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect C99 to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of C99 from memory before moving on to harder problems.

Reference excerpt

C99 (C9X during its development, formally ISO/IEC 9899:1999) is a past version of the C programming language open standard. It extends the previous version (C90) with new features for the language and the standard library, and helps implementations make better use of available computer hardware, such as IEEE 754-1985 floating-point arithmetic, and compiler technology. The C11 version of the C programming language standard, published in 2011, updates C99.

History After ANSI produced the official standard for the C programming language in 1989, which became an international standard in 1990, the C language specification remained relatively static for some time, while C++ continued to evolve, largely during its own standardization effort. Normative Amendment 1 created a new standard for C in 1995, but only to correct some details of the 1989 standard and to add more extensive support for international character sets. The standard underwent further revision in the late 1990s, leading to the publication of ISO/IEC 9899:1999 in 1999, which was adopted as an ANSI standard in May 2000. The language defined by that version of the standard is commonly referred to as "C99". The international C standard is maintained by the working group ISO/IEC JTC1/SC22/WG14.

Design

C99 is, for the most part, backward compatible with C89, but it is stricter in some ways. In particular, a declaration that lacks a type specifier no longer has int implicitly assumed. The C standards committee decided that it was of more value for compilers to diagnose inadvertent omission of the type specifier than to silently process legacy code that relied on implicit int. In practice, compilers are likely to display a warning, then assume int and continue translating the program. C99 introduced several new features, many of which had already been implemented as extensions in several compilers:

Inline functions Intermingled declarations and code: variable declaration is no longer restricted to file scope or the start of a compound statement (block) Several new data types, including long long int, optional extended integer types, an explicit Boolean data type (_Bool), and complex types (_Complex type specifier) to represent complex numbers, with convenience macros bool and complex. _Bool was later renamed to bool in C23. Variable-length arrays. C11 later changed this to a conditional feature that implementations are not required to support. Flexible array members Support for one-line comments beginning with // (like that of BCPL, C++ and Java) New library functions, such as snprintf() New standard library headers, such as <stdbool.h>, <complex.h>, <tgmath.h>, and <inttypes.h> Type-generic math (macro) functions, in <tgmath.h>, which select a math library function based upon float, double, or long double arguments, etc. Optional support for IEEE 754-1985 floating point Designated initializers, allowing initializing a structure by field names (for example struct Vec3 v = { .i = 1, .j = 2, .k = 3 };) Compound literals, allowing constructing struct in function calls (for example foo((struct Vec3) {1, 2, 3});) Support for variadic macros (macros with a variable number of arguments) restrict qualification allows more aggressive code optimization, removing compile-time array access advantages previously held by FORTRAN over ANSI C Universal character names, which allows user variables to contain other characters than the standard character set: four-digit \u0040 or eight-digit hexadecimal sequences \U0001f431 Keyword static in array indices in parameter declarations, which indicates that pointer passed to the function is not NULL and has at least the specified amount of elements.. For example, void foo(int bar[static 100]); indicates that bar is non-null and points to an array of at least 100 ints. _Pragma(), a unary preprocessing operator which does the same as #pragma. This was added because #pragma cannot be generated by a #define macro. It takes a single string literal as its argument (for example _Pragma("something")). #pragma STDC CX_LIMITED_RANGE, a pragma that indicates to the compiler whether it can use fast, standard formulas for operations on complex numbers. When disabled, the compiler performs checks for infinity, NaN, and other edge cases. It may be set to ON, OFF, and DEFAULT. Some C99 features were excluded from C++, notably variable-length arrays. C++ offers sequential data structures like std::vector<T> for similar purposes. Other features were eventually added into C++, such as designated initializers which were added in C++20.

IEEE 754 floating-point support A major feature of C99 is its numerics support, and in particular its support for access to the features of IEEE 754-1985 (also known as IEC 60559) floating-point hardware present in the vast majority of modern processors (defined in "Annex F IEC 60559 floating-point arithmetic"). Platforms without IEEE 754 hardware can also implement it in software. FLT_EVAL_METHOD is a macro that specifies the precision and range used by the implementation for floating-point arithmetic operations.

On platforms with IEEE 754 floating point:

FLT_EVAL_METHOD == 2 tends to limit the risk of rounding errors affecting numerically unstable expressions (see IEEE 754 design rationale) and is the designed default method for x87 hardware, but yields unintuitive behavior for the unwary user; FLT_EVAL_METHOD == 1 was the default evaluation method originally used in K&R C, which promoted all floats to double in expressions; and FLT_EVAL_METHOD == 0 is also commonly used and specifies a strict "evaluate to type" of the operands. (For gcc, FLT_EVAL_METHOD == 2 is the default on 32-bit x86, and FLT_EVAL_METHOD == 0 is the default on 64-bit x86-64, but FLT_EVAL_METHOD == 2 can be specified on x86-64 with option -mfpmath=387.) Before C99, compilers could round intermediate results inconsistently, especially when using x87 floating-point hardware, leading to compiler-specific behaviour; such inconsistencies are not permitted in compilers conforming to C99 (annex F). #pragma STDC FP_CONTRACT is a standard compiler directive that indicates to the compiler whether it may contract multiple floating-point instructions into a single fused multiply-add instruction. When disabled, the compiler strictly evaluates operations separately. It may be set to ON, OFF, or DEFAULT.

Example The following annotated example C99 code for computing a continued fraction function demonstrates the main features:

Footnotes:

… excerpt ends here. Continue reading the full article.

Illustrations

C99: Cover of the C99 standards document
Cover of the C99 standards document
C99 illustration

Worked examples

Example 1 — a first encounter with C99

Start with the simplest possible case. Write down what C99 claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to C99 before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about C99 ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of C99

In research
C99 appears in science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses C99 in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
C99 is common in secondary-school and first-year university syllabi. It links to neighbouring topics C (programming language), IEC standards, ISO standards, so understanding it makes those chapters shorter.
In everyday life
Look for C99 outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “C99” →

How to study C99 in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what C99 means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain C99 out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is C99 in simple terms?

C99 (C9X during its development, formally ISO/IEC 9899:1999) is a past version of the C programming language open standard. It extends the previous version (C90) with new features for the language and the standard library, and helps implementations make better use of available computer hardware, su…

Why does C99 matter?

Because it connects several science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study C99?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on C99.

Tags

  • C (programming language)
  • IEC standards
  • ISO standards
  • Programming language standards
  • Unix programming tools

Keep exploring