[Issue 12547] floor/round/ceil that optionally return a specified integral type

d-bugmail at puremagic.com d-bugmail at puremagic.com
Fri Apr 11 03:00:20 PDT 2014


https://issues.dlang.org/show_bug.cgi?id=12547

--- Comment #1 from Don <clugdbug at yahoo.com.au> ---
FYI: They are defined to return floating-point values because that's what the
equivalent C functions do. They should not be modified.

Note that if you cast them to integers, you have to worry about overflow. So
that's more complicated.

Note also the existence of rndint() and rndlong().

--


More information about the Digitalmars-d-bugs mailing list