[erlang-questions] math ceil floor

Richard A. O'Keefe ok@REDACTED
Tue Jun 7 02:56:58 CEST 2016


On 4/06/16 9:37 AM, Samuel wrote:
[since Erlang has bignums, is there really a use case for ffloor/fceil?]

It's a good question. Consider, though
st> 1.234567892345d308 floor
1234567892345000045994571678608401106710733
5829204606430696621556869305373762371218809
5752361144544803343115156790092425340877711
3686294033518655059904033307189889822114268
2599325972381243272372510471571815988180764
3319328717607302344826137591755759767023287
7560828068588895392676568601198325562537703
49019136

Is this actually a *good* way to represent the answer?

How should this deal with -0, infinities, or NaNs?

Smalltalk and Lisp have both.






More information about the erlang-questions mailing list