commit 6b950e436b9d81edb982d740d02198ba184402fb
Author:     Michael Forney <[email protected]>
AuthorDate: Fri Feb 22 14:26:39 2019 -0800
Commit:     Michael Forney <[email protected]>
CommitDate: Wed Mar 13 11:59:33 2019 -0700

    sort: Use regular `double` for -n
    
    `long double` may require software emulation and the (possible) extra
    precision is unnecessary here.

diff --git a/sort.c b/sort.c
index 623b81e..9706e8f 100644
--- a/sort.c
+++ b/sort.c
@@ -177,7 +177,7 @@ static int
 slinecmp(struct line *a, struct line *b)
 {
        int res = 0;
-       long double x, y;
+       double x, y;
        struct keydef *kd;
 
        TAILQ_FOREACH(kd, &kdhead, entry) {
@@ -190,8 +190,8 @@ slinecmp(struct line *a, struct line *b)
                    TAILQ_LAST(&kdhead, kdhead) != TAILQ_FIRST(&kdhead)) {
                        res = 0;
                } else if (kd->flags & MOD_N) {
-                       x = strtold(col1.line.data, NULL);
-                       y = strtold(col2.line.data, NULL);
+                       x = strtod(col1.line.data, NULL);
+                       y = strtod(col2.line.data, NULL);
                        res = (x < y) ? -1 : (x > y);
                } else if (kd->flags & (MOD_D | MOD_F | MOD_I)) {
                        res = skipmodcmp(&col1.line, &col2.line, kd->flags);

Reply via email to