[Issue 7455] Allow a cast to discard precision from a floating point during constant folding

d-bugmail at puremagic.com d-bugmail at puremagic.com
Mon Feb 13 01:57:11 PST 2012


http://d.puremagic.com/issues/show_bug.cgi?id=7455


Walter Bright <bugzilla at digitalmars.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
                 CC|                            |bugzilla at digitalmars.com
         Resolution|                            |WONTFIX


--- Comment #4 from Walter Bright <bugzilla at digitalmars.com> 2012-02-13 01:56:55 PST ---
> So I've no reliable way to round to a single precision float?

Store it to a float variable that is owned by something the compiler doesn't
know about (and so cannot optimize it).

One way would be to pass it to an extern function:

   float foo(float);

and implement foo:

   float foo(float f) { return f; }

in some separately compiled module.

I think such a method adequately addresses this, and no language enhancement is
required.

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


More information about the Digitalmars-d-bugs mailing list