3 ms·
I wouldn't ever say that using floats compared to, say, precision decimals in any language is leaking an implementation detail. As a user of a library/API I ne
by madisp 12y ago
I wouldn't ever say that using floats compared to, say, precision decimals in any language is leaking an implementation detail.
As a user of a library/API I need to know if I can rely on it being precise or not.
- judk 12y agoFloat is an implementation detail. Precision is an API contract.
- dllthomas 12y agoRight. An interface exposed with integers may wind up using floats internally, or vice versa; numeric algorithms may wind up doing arbitrary things to precision and accuracy; &c. "You are passing around a float" puts some bounds on what can be delivered but that isn't really sufficient information when it matters and is useless fluff when it doesn't.