Opened 5 years ago

Closed 4 years ago

#13343 closed Bugs (obsolete)

erf(NaN) and erfc(NaN) do not return NaN

Reported by: Stéphane Laurent <laurent_step@…> Owned by: John Maddock
Milestone: To Be Determined Component: math
Version: Boost 1.65.0 Severity: Problem
Keywords: Cc:

Description

Hello,

It is expected that erf(NaN) and erfc(NaN) are NaN, but they are not:

#include <iostream>
#include <cmath>
#include "boost/math/special_functions/erf.hpp"

int main(){
    std::cout << boost::math::erf(nan("")) << "\n";
    std::cout << boost::math::erfc(nan("")) << "\n";
    return 0;
}

Output:

1
0

Change History (1)

comment:1 by John Maddock, 4 years ago

Resolution: obsolete
Status: newclosed
Note: See TracTickets for help on using tickets.