hours hours and minutes minutes. The hour hand moves smoothly: it covers 30° per hour, so it shifts by half a degree every minute.
Return the smaller of the two angles between the hour hand and the minute hand, in degrees. Answers within 10⁻⁵ of the exact value are accepted.hours=9, minutes=0 → 90.0
The hour hand is exactly on 9 and the minute hand on 12: a quarter turn apart, 90°.
hours=6, minutes=20 → 70.0
The minute hand points at 120°. In 20 minutes the hour hand has moved 10° past 180°, to 190°. The gap is 70°.
hours=12, minutes=50 → 85.0
The minute hand is at 300° and the hour hand at 25°. That is 275° one way, but only 360 − 275 = 85° the other way.
hours=9, minutes=0
90.0
Run checks the first 3 tests in your browser. Submit checks all 75 tests on the server, hidden ones included.