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