Opened 12 years ago

Last modified 10 years ago

#5176 new Bugs

test_assignment assumes fabs(float)

Reported by: hstong@… Owned by: Gunter
Milestone: To Be Determined Component: uBLAS
Version: Boost 1.45.0 Severity: Problem
Keywords: Cc:

Description

As per [lib.c.math] paragraphs 5 and 6, there are float and long double overloads for fabs():

  float fabs (float);
  long double fabs (long double);

libstdc++ apparently does not have the required overloads and is seems

libs/numeric/ublas/test/test_assignment.cpp

relies on this.

Patch provided.

Attachments (1)

test_assignment.cpp.patch (1.1 KB ) - added by hstong@… 12 years ago.
Add cast so fabs() call is proper.

Download all attachments as: .zip

Change History (5)

by hstong@…, 12 years ago

Attachment: test_assignment.cpp.patch added

Add cast so fabs() call is proper.

comment:1 by Steven Watanabe, 12 years ago

It would be better to cast to double instead of float.

comment:2 by Steven Watanabe, 12 years ago

Component: numericuBLAS
Owner: changed from Douglas Gregor to Gunter

comment:3 by hstong@…, 11 years ago

Yes, this should have been a cast to double.

comment:4 by j.ungermann@…, 10 years ago

This breaks a couple of tests with non-gcc compilers. So one should call it a bug. A different fix might be calling std::abs instead of std::fabs.

Note: See TracTickets for help on using tickets.