Opened 11 years ago

Closed 11 years ago

Last modified 7 years ago

#5729 closed Bugs (fixed)

Missing static_cast in fpt_limits

Reported by: Paul A. Bristow Owned by: Gennadiy Rozental
Milestone: Boost 1.59.0 Component: test
Version: Boost Development Trunk Severity: Problem
Keywords: test static_cast floating_point comparison Cc:

Description

Using Boost.Test with e_float (in sandbox, which requires always explicit conversion) reveals that a static_cast is missing in struct fpt_limits in floating_point_comparison:

static FPT min_value() {

return std::numeric_limits<FPT>::is_specialized

? (std::numeric_limits<FPT>::min)() : 0;

}

should use

static FPT min_value()

{

return std::numeric_limits<FPT>::is_specialized

? (std::numeric_limits<FPT>::min)() : static_cast<FPT>(0);

}

Oh and there are some tabs :-(

Compiles and seem to work OK with this change.

Change History (4)

comment:1 by Gennadiy Rozental, 11 years ago

Resolution: fixed
Status: newclosed

(In [75036]) Added missing static cast for non standard FPT Fixes #5729

comment:2 by Gennadiy Rozental, 11 years ago

Did not find any tabs

comment:3 by glesaaen@…, 7 years ago

Is there a reason this still hasn't made it to the release version of boost as of 1.58?

comment:4 by Raffi Enficiaud, 7 years ago

Milestone: To Be DeterminedBoost 1.59.0
Note: See TracTickets for help on using tickets.