Bug 5089 – feqrel does not compile for floats

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
Other
OS
Windows
Creation time
2010-10-20T16:07:00Z
Last change time
2012-05-28T14:04:18Z
Assigned to
nobody
Creator
ah08010-d

Comments

Comment #0 by ah08010-d — 2010-10-20T16:07:10Z
With 2.049, this code: ========== module scratch; import std.math; void foo() { float a = 1, b = 1.00000000001; auto same = feqrel( a, b ) > 15; } ========== Emits this diagnostic: ========== $ dmd scratch.d d:\Devel\D\dmd2\windows\bin\..\..\src\phobos\std\math.d(3286): Error: function std.math.feqrel!(float).feqrel has no return statement, but is expected to return a value of type int d:\Devel\D\dmd2\windows\bin\..\..\src\phobos\std\math.d(8): Error: template instance std.math.feqrel!(float) error instantiating ==========
Comment #1 by mike — 2011-07-09T08:07:12Z
As far as i know Don wrote both the feqrel function in tango and phobos. But he has only fixed the one in tango to work with floats. See: http://www.dsource.org/projects/tango/changeset/4108
Comment #2 by bugzilla — 2012-05-28T14:04:18Z