Search code examples
cliteralsopenblas

What does the numerical literal 0.e0f mean?


I am currently trying to debug an uninitialized memory error. I have now come across the numerical literal 0.e0f in the OpenBlas source code (which is what the debugger is currently at) what does that mean?

The context is this:

if ((alpha_r == 0.e0f) && (alpha_i == 0.e0f)) return;

The 0.e0f evaluates to 0 apparently.


Solution

  • A floating-point literals have two syntaxes. The first one consists of the following parts:

    • nonempty sequence of decimal digits containing a decimal point character (defines significand)
    • (optional) e or E followed with optional minus or plus sign and nonempty sequence of decimal digits (defines exponent)
    • (optional) a suffix type specifier as a l, f, L or F

    The second one consists of the following parts:

    • nonempty sequence of decimal digits (defines significant)
    • e or E followed with optional minus or plus sign and nonempty sequence of decimal digits (defines exponent)
    • (optional) a suffix type specifier as a l, f, L or F

    The suffix type specifier defines the actual type of the floating-point literal:

    • (no suffix) defines double
    • f F defines float
    • l L defines long double