"4.12.0". Leading zeros in a part mean nothing: "012" is 12.
Versions are compared part by part from left to right, and the first pair of differing parts decides. If one version has fewer parts, the missing ones count as 0.
Given two versions left and right, return -1 if left is older (smaller) than right, 1 if it is newer (larger), and 0 if they are equal.left="2.9.1", right="2.10" → -1
The first parts are equal (2 and 2); in the second ones 9 < 10, so left is older. Nothing further needs comparing.
left="3.04", right="3.4.0" → 0
04 means 4, and the missing third part of left counts as zero. The versions are equal.
left="1.0.7", right="1" → 1
The second and third parts of right count as zeros, and 7 > 0, so left is newer.
left, right ≤ 500left="2.9.1", right="2.10"
-1
Run checks the first 3 tests in your browser. Submit checks all 122 tests on the server, hidden ones included.