• Sorts an array of Big numbers in ascending order

    Parameters

    • data: Big[]

      Array of Big numbers to sort

    Returns Big[]

    A new array with the numbers sorted in ascending order

    const numbers = [
    new Big('10.5'),
    new Big('2.3'),
    new Big('15.7')
    ];

    const sorted = sort(numbers);
    // Returns [Big('2.3'), Big('10.5'), Big('15.7')]
    // Original array remains unchanged
    • Creates a new array, preserving the original array's order
    • Uses the standard compare function for consistent sorting behavior
    • Handles negative numbers and decimals correctly
    • Time complexity: O(n log n) where n is the array length