Thread overview
[Issue 14] ARM: runnable/testmath.d Arm not precise enough?
Sep 25, 2012
Johannes Pfau
Sep 25, 2012
Iain Buclaw
Sep 27, 2012
Johannes Pfau
Sep 27, 2012
Iain Buclaw
Oct 01, 2012
Johannes Pfau
September 25, 2012
http://gdcproject.org/bugzilla/show_bug.cgi?id=14

--- Comment #1 from Johannes Pfau <johannespfau@gmail.com> 2012-09-25 12:13:08 UTC ---
What is this test supposed to do?

----
    int exp;
    real mantissa = frexp(123.456, exp);
    assert(equals(mantissa * pow(2.0L, cast(real)exp), 123.456, 19));
----
equals: x = 67.456
equals: y = 123.456
equals: ndigits = 19
bufx = '67.45600000000000307'
bufy = '123.4560000000000031'
core.exception.AssertError@testmath.d(170): Assertion failure

-- 
Configure issuemail: http://gdcproject.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all issue changes.
September 25, 2012
http://gdcproject.org/bugzilla/show_bug.cgi?id=14

--- Comment #2 from Iain Buclaw <ibuclaw@gdcproject.org> 2012-09-25 16:53:49 UTC ---
An alternate option could be to rethink the codegen for floating comparisons in GDC overall, as certain floating point comparisons fail in GDC x86/x86_64 too.


Problem:
Simply doing (A == B) is not correct.


Possible solution:
The comparison with an epsilon value is what most tends to be done in game
programming.

However the following:
(diff = A - B, (diff < EPSILON) && (-diff > EPSILON)))

Is a bit of wasted processing for something that should be fast, yet effective.


Here's an interesting read-up: http://realtimecollisiondetection.net/blog/?p=89


Regards
Iain

-- 
Configure issuemail: http://gdcproject.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all issue changes.
September 27, 2012
http://gdcproject.org/bugzilla/show_bug.cgi?id=14

Johannes Pfau <johannespfau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
         AssignedTo|ibuclaw@gdcproject.org      |johannespfau@gmail.com

--- Comment #3 from Johannes Pfau <johannespfau@gmail.com> 2012-09-27 17:35:31 UTC ---
Not sure if we should do anything about this in the compiler. I wonder what dmd does?

Anyway: https://github.com/D-Programming-Language/dmd/pull/1146 http://forum.dlang.org/thread/k3v614$2882$1@digitalmars.com

hopefully fixed soon in upstream

-- 
Configure issuemail: http://gdcproject.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all issue changes.
September 27, 2012
http://gdcproject.org/bugzilla/show_bug.cgi?id=14

Iain Buclaw <ibuclaw@gdcproject.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |ibuclaw@gdcproject.org

--- Comment #4 from Iain Buclaw <ibuclaw@gdcproject.org> 2012-09-27 17:38:07 UTC ---
Cool beans.

By the way, if there's anything you need downstreaming to gdc, just send it my way.

Thanks.

-- 
Configure issuemail: http://gdcproject.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all issue changes.
October 01, 2012
http://gdcproject.org/bugzilla/show_bug.cgi?id=14

Johannes Pfau <johannespfau@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED

--- Comment #5 from Johannes Pfau <johannespfau@gmail.com> 2012-10-01 15:12:20 UTC ---
@Iain sure, I'll do that. But most of those fixes are just errors in the test suite, not really errors in the library/compiler, so that stuff can wait till the 2.061 merge.

testmath.d has been removed from the test suite in upstream dmd (2.061), so I'm
closing this. I hope Don won't forget the fix for frexp though.
https://github.com/D-Programming-Language/dmd/commit/77ad29c6b38897881e849d6f80165921febe1293

-- 
Configure issuemail: http://gdcproject.org/bugzilla/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are watching all issue changes.