[Issue 12547] New: floor/round/ceil that optionally return a specified integral type
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Tue Apr 8 12:40:24 PDT 2014
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: nobody at puremagic.com
ReportedBy: bearophile_hugs at eml.cc
--- Comment #0 from bearophile_hugs at eml.cc 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: -------
More information about the Digitalmars-d-bugs
mailing list