Skip to content

<cmath> does not publish std::fpclassify() #40

@ckormanyos

Description

@ckormanyos

I was doing some standard mathematical calculations and I found empirically that

  • <cmath> does not publish std::fpclassify.
  • There are also no definitions for FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL and FP_ZERO.

There is an implementation of fpclassify in std present in the file, but it is hidden within some compiler switches that I don't understand. It is rather straightforward to implement, if that is the answer here.

If I'm not mistaken, I think we need in namespace std:

int fpclassify( float num );
int fpclassify( double num );
int fpclassify( long double num );

And I think we also need the constants FP_NAN, FP_INFINITE, FP_NORMAL, FP_SUBNORMAL and FP_ZERO.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions