• marcos@lemmy.world
    link
    fedilink
    arrow-up
    2
    ·
    edit-2
    8 hours ago
    >> typeof(NaN)
    <- "number"
    

    It’s valid for C too, but it will be either a double or a float.

    • zerofk@lemmy.zip
      link
      fedilink
      arrow-up
      2
      ·
      3 hours ago
      #include <cmath>
      #include <iostream>
      #include <numbers>
      
      int main()
      {
        decltype ( NAN ) f { std::numbers::pi };
        std::cout << f << std::endl;
      } 
      
      • marcos@lemmy.world
        link
        fedilink
        arrow-up
        1
        ·
        3 hours ago

        Dude, after forcing -std=c++20, the compiler still can’t find a reference for std::ostream::operator<<(float)

        Do I have to link with some non-standard library? There doesn’t seem to have any numbers.a included with gcc.