Someone recently asked me why Math.Floor return a double? I chatted with some folks on the team and got this response.

 

You could ask the same question about Sin, Log and all the other things on Math: they all take and return Double and are subject to the same precision issues.

 

Admittedly, Math.Floor is a little weird, because it returns a whole integer. However, it can't return any normal integer, because Int64 can't cover the full range of Double. The only return value that would make more sense would be Decimal.

 

You could make a reasonable case that there should be Decimal versions of most or all of the methods on Math. We should probably consider that a reasonable end-point for the long term evolution of this class.

 

We are of course looking at adding more overloads in the future.