September 18, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8689

           Summary: Variant opArithmetic does not attempt float conversion
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody@puremagic.com
        ReportedBy: callumenator@gmail.com


--- Comment #0 from callumenator@gmail.com 2012-09-18 13:27:20 PDT ---
Variant tries to mimic D's built-in rules for arithmetic conversions but:

import std.variant, std.stdio;
void main()
{
  auto v1 = Variant(4.5f);
  auto v2 = Variant(3.5f);
  writeln((v1+v2).type()); // double (should be float)
}

The reason is Variant doesn't try to convert to float in opArithmetic. I have submitted a pull request fixing this.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 28, 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8689



--- Comment #1 from github-bugzilla@puremagic.com 2012-09-28 06:40:48 PDT ---
Commit pushed to master at https://github.com/D-Programming-Language/phobos

https://github.com/D-Programming-Language/phobos/commit/d94803416b683e4aa693c92133c258e8cfc730d6 Merge pull request #805 from callumenator/master

Fix for issue 8689, Variant doesn't attempt float conversion in opArithmetic

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
January 02, 2013
http://d.puremagic.com/issues/show_bug.cgi?id=8689


yebblies <yebblies@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |yebblies@gmail.com
         Resolution|                            |FIXED


--- Comment #2 from yebblies <yebblies@gmail.com> 2013-01-02 19:28:32 EST ---
Seems to be fixed in 2.061

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Top | Discussion index | About this forum | D home