Advice:
I'm guessing 99-02 it would be E46? The make sure they've had the recall for the Big end shells? (I think it was Big end?). Other than that they're very reliable! And a great car all round speed (depending what you're comparing it too?)/ handling/comfort/reliability etc.
E39 M5 heard they're a few problems (I think crank sensor is one?) but they're another great all round car.
Personally I would go E46.