Need help with random numbers

Basically what I want is to have a random angle between 315 degrees and 45. How do i do that?
And btw I don’t mean 45 between 315, it should exclude everything between those numbers.
Example:

45 = max = 405 degrees
315 = min = 315 degrees
90 = bad
180 = bad
270 = bad

Nevermind I got it it’s in this format:
angle = Math.random() * (405 - 315) + 315;

When I posted this I forgot about the tutorial that told you how to do what i was asking.