This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
Here are five different implementations of the same floorSqrt() | |
functional composition. | |
They seem to be identical, but they deserve scrutiny. | |
But there are a few key differences we should go over: | |
Obviously the first method is verbose and inefficient. | |
The second method is a nice one-liner, but this approach becomes very unreadable | |
after only a few functions are applied. | |
The third approach is a chain of array functions, notably the map function. This works | |
fairly well, but it is not mathematically correct. |
NewerOlder