1 # $NetBSD: cond-cmp-numeric-lt.mk,v 1.1 2020/08/23 13:50:17 rillig Exp $
3 # Tests for numeric comparisons with the < operator in .if conditions.
5 # When both sides are equal, the < operator always yields false.
10 # This comparison yields the same result, whether numeric or character-based.
20 # If this comparison were character-based instead of numerical, the
21 # 5 would be > 14 since its first digit is greater.
31 # Scientific notation is supported, as per strtod.
41 # Floating pointer numbers can be compared as well.
42 # This might be tempting to use for version numbers, but there are a few pitfalls.
52 # When parsed as a version number, 3.30 is greater than 3.7.
53 # Since make parses numbers as plain numbers, that leads to wrong results.
54 # Numeric comparisons are not suited for comparing version number.
64 # As of 2020-08-23, numeric comparison is implemented as parsing both sides
65 # as double, and then performing a normal comparison. The range of double is
66 # typically 16 or 17 significant digits, therefore these two numbers seem to
68 .if 1.000000000000000001 < 1.000000000000000002