Negative or positive

Given a number, write a method that returns number to the power of 2 if negative or square root if positive or zero.
Expected input and output
NegativeOrPositive(-2) → 4 NegativeOrPositive(6.25) → 2.5
using System;

namespace CSharpExercises.Exercises.Library_functions
{
    class NegativeOrPositiveTask
    {
        public static double NegativeOrPositive(double num)
        {
            return num < 0 ? Math.Pow(num, 2) : Math.Sqrt(num);
        }

        public static void Main()
        {
            Console.WriteLine(NegativeOrPositive(72946));       // 270.085171751431
            Console.WriteLine(NegativeOrPositive(-4.726));      // 22.335076
            Console.WriteLine(NegativeOrPositive(0));             // 0
            Console.WriteLine(NegativeOrPositive(3.334));       // 1.82592442340859
            Console.WriteLine(NegativeOrPositive(-59));         // 3481
        }
    }
}