Is there a function which returns the largest value in systemverilog? like max() in c++?

as described in the subtitle. I want to use a function to return the larger value.

There is no built-in function to compare two numbers and return the largest. There is a max method for arrays that returns the largest element in the array.

You should use the let statement instead of a function to handle values of any type.

let max(a,b) = (a > b) ? a : b;

In reply to dave_59:

Thanks Dave!