This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

Does IAR Embedded Workbench compiler support "numeric_limits" in C++?

Hi, 

I've include the header file "#icnlude <limits>" and using numeric_limits in my coding like numeric_limis<float>.min() and numeric_limis<float>.max().

However, a compilation error report to indicate the "numeric_limits" is undefined. I'm verified that the "numeric_limits" is working fine in Visual Studio.

Therefore, I'm wondering is it possible to get the numeric_limits support in IAR compiler, and am I missing out on any header file?

Appreciate if you can help to clarify the problem mentioned.

Thanks and Regards

Chris kok

Parents
  • Hi Stephen,

    Thanks for your reply.

    I found the answer already. The problem was due to I missed out the "std::". Once added in the "std::" as shown below, the problem resolved.

    std::numeric_limits<float>::min() and std::numeric_limits<float>::max().

    To using those standard library components, a "std::" is needed or have declaring the "using namespace std;" right after the include file.

    Anyway, thank you very much.

    Regards

    Chris

Reply
  • Hi Stephen,

    Thanks for your reply.

    I found the answer already. The problem was due to I missed out the "std::". Once added in the "std::" as shown below, the problem resolved.

    std::numeric_limits<float>::min() and std::numeric_limits<float>::max().

    To using those standard library components, a "std::" is needed or have declaring the "using namespace std;" right after the include file.

    Anyway, thank you very much.

    Regards

    Chris

Children