7 ms·
These are points that need to be addressed for any implementation of R, or any other domain specific language for which numerical guarantees nearly always outwe
by bedatadriven 13y ago
These are points that need to be addressed for any implementation of R, or any other domain specific language for which numerical guarantees nearly always outweigh performance concerns.
GNU R, for example, is implemented in C, and the implementations of R's basic arithmetic functions are actually quite complicated because they take care of so many of the edge cases cited in the cited post. For example, the round() function casts its argument first to a 64-bit before calling the C library's rint() function to preserve precision. [1]
[1] http://svn.r-project.org/R/trunk/src/nmath/fround.c http://svn.r-project.org/R/trunk/src/nmath/fround.c