Enhance the mode() function to return an array of all mode values instead of returning just a single mode value.
According to mathematical definitions, a dataset can have multiple modes (bimodal or multimodal distributions). This update aligns the mode() function with this mathematical truth, making it more accurate and useful.
Added unit tests to confirm that:
An array of a single mode is returned when there is one mode.
An array of multiple modes is returned when there are multiple modes.
An array of all numbers is returned when each number is unique and thus all are modes.
Enhance the mode() function to return an array of all mode values instead of returning just a single mode value.
According to mathematical definitions, a dataset can have multiple modes (bimodal or multimodal distributions). This update aligns the mode() function with this mathematical truth, making it more accurate and useful.
Added unit tests to confirm that: An array of a single mode is returned when there is one mode. An array of multiple modes is returned when there are multiple modes. An array of all numbers is returned when each number is unique and thus all are modes.