www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10187] New: Precision of floating-point returned values

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10187

           Summary: Precision of floating-point returned values
           Product: D
           Version: D2
          Platform: x86
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody puremagic.com
        ReportedBy: thecybershadow gmail.com


--- Comment #0 from Vladimir Panteleev <thecybershadow gmail.com> 2013-05-28
09:54:51 EEST ---
real n = 6287.4;
float f() { return n; }

void main()
{
    assert(f() == f());
}

The assert fails, presumably because one value is on the stack, and another is
in an FPU register.

Stumbled upon it while attempting:

allData.sort!((a, b) => a["!Price"].to!float() < b["!Price"].to!float())();

std.algorithm throws, because "Predicate for isSorted is not antisymmetric".

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 27 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10187


Maxim Fomin <maxim maxim-fomin.ru> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |maxim maxim-fomin.ru


--- Comment #1 from Maxim Fomin <maxim maxim-fomin.ru> 2013-05-28 00:02:05 PDT
---
This is a dup of issue 8745.

You can use is operator for identity check.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 28 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10187


Vladimir Panteleev <thecybershadow gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE


--- Comment #2 from Vladimir Panteleev <thecybershadow gmail.com> 2013-05-28
10:05:10 EEST ---
Thanks!

*** This issue has been marked as a duplicate of issue 8476 ***

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 28 2013