https://d.puremagic.com/issues/show_bug.cgi?id=12547
Summary: floor/round/ceil that optionally return a specified
integral type
Product: D
Version: D2
Platform: All
OS/Version: All
Status: NEW
Severity: enhancement
Priority: P2
Component: Phobos
AssignedTo: [email protected]
ReportedBy: [email protected]
--- Comment #0 from [email protected] 2014-04-08 12:40:20 PDT ---
With a small counting I've seen that in my code I have often to cast the result
of the functions floor/round/ceil to integral values, like:
cast(ubyte)round(x)
cast(int)floor(y)
But I prefer to avoid casts in my code. So I suggest to modify them (or to add
new small functions) in Phobos that accept a template argument to specify the
result integer type:
round!ubyte(x)
floor!int(y)
--
Configure issuemail: https://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------