Thread overview
[Issue 4306] New: std.numeric.CustomFloat doesn't work on Mac OS X.
Jun 13, 2010
Masahiro Nakagawa
Jun 13, 2010
David Simcha
Jun 15, 2010
Masahiro Nakagawa
Jun 18, 2010
David Simcha
June 13, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4306

           Summary: std.numeric.CustomFloat doesn't work on Mac OS X.
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Mac OS X
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: repeatedly@gmail.com


--- Comment #0 from Masahiro Nakagawa <repeatedly@gmail.com> 2010-06-13 14:01:40 PDT ---
I tested following code using dmd 2.047 on Mac OS X 10.6.3.

-----
import std.numeric;

void main()
{
    CustomFloat!16 a;
}
-----

compilation result:

std/numeric.d(476): Error: template instance ToBinary!(real) does not match
template declaration ToBinary(F) if (is(CustomFloat!(F.sizeof * 8)))
std/numeric.d(476): Error: ToBinary!(real) is used as a type
std/numeric.d(476): Error: variable
std.numeric.CustomFloat!(precision,exponentWidth,flags,15).CustomFloat.get!(real).get.result
voids have no value

I think this cause is real type size. real.sizeof is 16 on Mac OS X, but current std.numeric.CustomFloat can't treat those environments.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 13, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4306


David Simcha <dsimcha@yahoo.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |dsimcha@yahoo.com


--- Comment #1 from David Simcha <dsimcha@yahoo.com> 2010-06-13 16:35:44 PDT ---
This code was initially only tested on Windows, which doesn't use this padding.
 Linux also uses padding, though to 12 bytes instead of 16.  I've checked in a
fix that works on Linux.  It should work for Mac, too but I can't test it
because I don't own a Mac.  Please let me know whether it does.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 15, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4306



--- Comment #2 from Masahiro Nakagawa <repeatedly@gmail.com> 2010-06-15 16:24:11 PDT ---
Thanks for the fix.
I tested modified #0 code using trunk, No problem!

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
June 18, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=4306


David Simcha <dsimcha@yahoo.com> changed:

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


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