use print_shortest_float() for matrix values

Change-Id: I734400314e9d3b95b7ca342930d44ffeafc67d3b
Reviewed-on: https://skia-review.googlesource.com/c/skcms/+/399159
Reviewed-by: Brian Osman <brianosman@google.com>
Commit-Queue: Mike Klein <mtklein@google.com>
diff --git a/profiles/color.org/Upper_Left.icc.txt b/profiles/color.org/Upper_Left.icc.txt
index 2fdaa9c..7437918 100644
--- a/profiles/color.org/Upper_Left.icc.txt
+++ b/profiles/color.org/Upper_Left.icc.txt
@@ -25,9 +25,9 @@
   ~= : 2.034415, 1, -6.80238e-06, 1.290439, 0.05490196, 0.06838989, 0 (Max error: 0.162423) (D-gap: 0.000268772) (f(1) = 1.06838)
   M2 : 16-bit table with 256 entries
   ~= : 2.034415, 1, -6.80238e-06, 1.290439, 0.05490196, 0.06838989, 0 (Max error: 0.162423) (D-gap: 0.000268772) (f(1) = 1.06838)
-Mtrx : | 0.959396958 0.84733814 0.314814538 -0.503105104 |
-       | 0.489433438 1.57752109 0.133390293 -0.521812081 |
-       | 0.0305781476 0.213589266 1.57086837 -0.430443883 |
+Mtrx : | 0.95939695 0.84733814 0.31481453 -0.5031051 |
+       | 0.48943343 1.5775210 0.13339029 -0.5218120 |
+       | 0.030578147 0.21358926 1.5708683 -0.43044388 |
  "B" : 3 outputs
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
@@ -37,9 +37,9 @@
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B2 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
-Mtrx : | 1.00349426 0 0 -0.00168612192 |
-       | 0 1.00348663 0 -0.0017395285 |
-       | 0 0 1.00349426 -0.00144197757 |
+Mtrx : | 1.0034942 0. 0. -0.0016861219 |
+       | 0. 1.0034866 0. -0.0017395285 |
+       | 0. 0. 1.0034942 -0.0014419775 |
  "M" : 3 inputs
   M0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   M1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
diff --git a/profiles/color.org/Upper_Right.icc.txt b/profiles/color.org/Upper_Right.icc.txt
index b32e2c8..837b17e 100644
--- a/profiles/color.org/Upper_Right.icc.txt
+++ b/profiles/color.org/Upper_Right.icc.txt
@@ -27,9 +27,9 @@
   ~= : 2.470196, 1, -9.961426e-06, 0.9400777, 0.05882353, 0.05463409, 0 (Max error: 0.168172) (D-gap: 0.000247952) (f(1) = 1.05461)
   M2 : 16-bit table with 256 entries
   ~= : 2.470196, 1, -9.961426e-06, 0.9400777, 0.05882353, 0.05463409, 0 (Max error: 0.168172) (D-gap: 0.000247952) (f(1) = 1.05461)
-Mtrx : | 2.20205379 1.94485557 0.72255367 -0.733356714 |
-       | 1.12339592 3.6207943 0.306147665 -0.760608494 |
-       | 0.0701893568 0.490257412 3.60553575 -0.62743181 |
+Mtrx : | 2.2020537 1.9448555 0.7225536 -0.7333567 |
+       | 1.1233959 3.6207943 0.30614766 -0.7606084 |
+       | 0.07018935 0.4902574 3.6055357 -0.6274318 |
  "B" : 3 outputs
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
diff --git a/profiles/color.org/sRGB_ICC_v4_Appearance.icc.txt b/profiles/color.org/sRGB_ICC_v4_Appearance.icc.txt
index 4546225..62ea436 100644
--- a/profiles/color.org/sRGB_ICC_v4_Appearance.icc.txt
+++ b/profiles/color.org/sRGB_ICC_v4_Appearance.icc.txt
@@ -25,9 +25,9 @@
   M0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   M1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   M2 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
-Mtrx : | 1 0 0 0 |
-       | 0 1 0 0 |
-       | 0 0 1 0 |
+Mtrx : | 1. 0. 0. 0. |
+       | 0. 1. 0. 0. |
+       | 0. 0. 1. 0. |
  "B" : 3 outputs
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
@@ -37,9 +37,9 @@
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B2 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
-Mtrx : | 1 0 0 0 |
-       | 0 1 0 0 |
-       | 0 0 1 0 |
+Mtrx : | 1. 0. 0. 0. |
+       | 0. 1. 0. 0. |
+       | 0. 0. 1. 0. |
  "M" : 3 inputs
   M0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   M1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
diff --git a/profiles/color.org/sRGB_v4_ICC_preference.icc.txt b/profiles/color.org/sRGB_v4_ICC_preference.icc.txt
index c4bd666..1072f1b 100644
--- a/profiles/color.org/sRGB_v4_ICC_preference.icc.txt
+++ b/profiles/color.org/sRGB_v4_ICC_preference.icc.txt
@@ -25,9 +25,9 @@
   M0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   M1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   M2 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
-Mtrx : | 1 0 0 0 |
-       | 0 1 0 0 |
-       | 0 0 1 0 |
+Mtrx : | 1. 0. 0. 0. |
+       | 0. 1. 0. 0. |
+       | 0. 0. 1. 0. |
  "B" : 3 outputs
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
@@ -37,9 +37,9 @@
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B2 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
-Mtrx : | 1 0 0 0 |
-       | 0 1 0 0 |
-       | 0 0 1 0 |
+Mtrx : | 1. 0. 0. 0. |
+       | 0. 1. 0. 0. |
+       | 0. 0. 1. 0. |
  "M" : 3 inputs
   M0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   M1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
diff --git a/profiles/fuzz/b2a_no_clut.icc.txt b/profiles/fuzz/b2a_no_clut.icc.txt
index 63d5188..6d24c14 100644
--- a/profiles/fuzz/b2a_no_clut.icc.txt
+++ b/profiles/fuzz/b2a_no_clut.icc.txt
@@ -26,9 +26,9 @@
   M1 : 16-bit table with 2 entries
   ~= : 1, 0.1445182, 0, 0, 0, 0, 0 (Max error: 0.00012207) (f(1) = 0.144499)
   M2 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
-Mtrx : | 49907.2383 519.882812 0.00149533851 2.00708008 |
-       | 0.00012206845 0.00149533851 0.000976547599 1.65762854 |
-       | 0.00149533851 1028.01941 1.91552866 710.906677 |
+Mtrx : | 49907.23 519.8828 0.0014953385 2.00708 |
+       | 0.00012206845 0.0014953385 0.0009765476 1.6576285 |
+       | 0.0014953385 1028.0194 1.9155286 710.9066 |
  "B" : 3 outputs
   B0 : 16-bit table with 2 entries
   ~= : 1, 0.1757687, 0, 0, 0, 0, 0 (Max error: 1.02224) (f(1) = 0.17577)
diff --git a/profiles/fuzz/one_d_clut.icc.txt b/profiles/fuzz/one_d_clut.icc.txt
index 31021ef..3cab021 100644
--- a/profiles/fuzz/one_d_clut.icc.txt
+++ b/profiles/fuzz/one_d_clut.icc.txt
@@ -25,9 +25,9 @@
   ~= : 2.470196, 1, -9.961426e-06, 0.9400777, 0.05882353, 0.05463409, 0 (Max error: 0.388634) (D-gap: 0.000247952) (f(1) = 1.05461)
   M2 : 16-bit table with 256 entries
   ~= : 2.470196, 1, -9.961426e-06, 0.9400777, 0.05882353, 0.05463409, 0 (Max error: 0.172776) (D-gap: 0.000247952) (f(1) = 1.05461)
-Mtrx : | 2.20205379 1.94485557 4.72249269 -0.733356714 |
-       | 1.12339592 3.6207943 0.306147665 -0.760608494 |
-       | 0.0701893568 0.490257412 3.60553575 -0.62743181 |
+Mtrx : | 2.2020537 1.9448555 4.7224926 -0.7333567 |
+       | 1.1233959 3.6207943 0.30614766 -0.7606084 |
+       | 0.07018935 0.4902574 3.6055357 -0.6274318 |
  "B" : 3 outputs
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
diff --git a/profiles/misc/Apple_Wide_Color.icc.txt b/profiles/misc/Apple_Wide_Color.icc.txt
index dc55883..227be96 100644
--- a/profiles/misc/Apple_Wide_Color.icc.txt
+++ b/profiles/misc/Apple_Wide_Color.icc.txt
@@ -24,9 +24,9 @@
   M0 : 2.399994, 0.9479065, 0.05209351, 0.07739258, 0.03930664, 0, 0 (D-gap: -3.51667e-06) (f(1) = 1) (~sRGB)
   M1 : 2.399994, 0.9479065, 0.05209351, 0.07739258, 0.03930664, 0, 0 (D-gap: -3.51667e-06) (f(1) = 1) (~sRGB)
   M2 : 2.399994, 0.9479065, 0.05209351, 0.07739258, 0.03930664, 0, 0 (D-gap: -3.51667e-06) (f(1) = 1) (~sRGB)
-Mtrx : | 0.507255435 0.301234424 0.155698314 0 |
-       | 0.239345714 0.694691539 0.0659779981 0 |
-       | 0.000457756687 0.0473930761 0.777148783 0 |
+Mtrx : | 0.50725543 0.30123442 0.15569831 0. |
+       | 0.23934571 0.69469153 0.065978 0. |
+       | 0.0004577566 0.047393076 0.7771487 0. |
  "B" : 3 outputs
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
diff --git a/profiles/misc/sRGB_ICC_v4_beta.icc.txt b/profiles/misc/sRGB_ICC_v4_beta.icc.txt
index d211f61..7e32513 100644
--- a/profiles/misc/sRGB_ICC_v4_beta.icc.txt
+++ b/profiles/misc/sRGB_ICC_v4_beta.icc.txt
@@ -25,9 +25,9 @@
   M0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   M1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   M2 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
-Mtrx : | 1 0 0 0 |
-       | 0 1 0 0 |
-       | 0 0 1 0 |
+Mtrx : | 1. 0. 0. 0. |
+       | 0. 1. 0. 0. |
+       | 0. 0. 1. 0. |
  "B" : 3 outputs
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
@@ -37,9 +37,9 @@
   B0 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B1 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
   B2 : 1, 1, 0, 0, 0, 0, 0 (f(1) = 1) (~Identity)
-Mtrx : | 1 0 0 0 |
-       | 0 1 0 0 |
-       | 0 0 1 0 |
+Mtrx : | 1. 0. 0. 0. |
+       | 0. 1. 0. 0. |
+       | 0. 0. 1. 0. |
  "M" : 3 inputs
   M0 : 16-bit table with 256 entries
   ~= : 1, 0.9999847, 0, 0, 0, 0, 0 (Max error: 0.000143826) (f(1) = 0.999996) (~Identity)
diff --git a/test_only.c b/test_only.c
index a8e6b3f..992ddbf 100644
--- a/test_only.c
+++ b/test_only.c
@@ -297,12 +297,21 @@
                 dump_curve(fp, curveNames[i], &a2b->matrix_curves[i]);
             }
             const skcms_Matrix3x4* m = &a2b->matrix;
-            fprintf(fp, "Mtrx : | %.9g %.9g %.9g %.9g |\n"
-                        "       | %.9g %.9g %.9g %.9g |\n"
-                        "       | %.9g %.9g %.9g %.9g |\n",
-                   m->vals[0][0], m->vals[0][1], m->vals[0][2], m->vals[0][3],
-                   m->vals[1][0], m->vals[1][1], m->vals[1][2], m->vals[1][3],
-                   m->vals[2][0], m->vals[2][1], m->vals[2][2], m->vals[2][3]);
+            fprintf(fp, "Mtrx : | ");
+            print_shortest_float(fp, m->vals[0][0]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[0][1]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[0][2]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[0][3]); fprintf(fp, " |\n");
+            fprintf(fp, "       | ");
+            print_shortest_float(fp, m->vals[1][0]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[1][1]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[1][2]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[1][3]); fprintf(fp, " |\n");
+            fprintf(fp, "       | ");
+            print_shortest_float(fp, m->vals[2][0]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[2][1]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[2][2]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[2][3]); fprintf(fp, " |\n");
         }
 
         {
@@ -329,12 +338,21 @@
 
         if (b2a->matrix_channels) {
             const skcms_Matrix3x4* m = &b2a->matrix;
-            fprintf(fp, "Mtrx : | %.9g %.9g %.9g %.9g |\n"
-                        "       | %.9g %.9g %.9g %.9g |\n"
-                        "       | %.9g %.9g %.9g %.9g |\n",
-                   m->vals[0][0], m->vals[0][1], m->vals[0][2], m->vals[0][3],
-                   m->vals[1][0], m->vals[1][1], m->vals[1][2], m->vals[1][3],
-                   m->vals[2][0], m->vals[2][1], m->vals[2][2], m->vals[2][3]);
+            fprintf(fp, "Mtrx : | ");
+            print_shortest_float(fp, m->vals[0][0]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[0][1]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[0][2]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[0][3]); fprintf(fp, " |\n");
+            fprintf(fp, "       | ");
+            print_shortest_float(fp, m->vals[1][0]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[1][1]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[1][2]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[1][3]); fprintf(fp, " |\n");
+            fprintf(fp, "       | ");
+            print_shortest_float(fp, m->vals[2][0]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[2][1]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[2][2]); fprintf(fp, " ");
+            print_shortest_float(fp, m->vals[2][3]); fprintf(fp, " |\n");
             fprintf(fp, "%4s : %u inputs\n", "\"M\"", b2a->matrix_channels);
             const char* curveNames[4] = { "M0", "M1", "M2" };
             for (uint32_t i = 0; i < b2a->matrix_channels; ++i) {
diff --git a/tests.c b/tests.c
index 0506a33..25c35d3 100644
--- a/tests.c
+++ b/tests.c
@@ -652,10 +652,8 @@
     "profiles/fuzz/negative_g_para.icc",              // chromium:836634
     "profiles/fuzz/b2a_too_few_output_channels.icc",  // oss-fuzz:33281
 
-#if !defined(_MSC_VER)  // TODO(mtklein): profile dump float rounding woes :(
     // A B2A profile with no CLUT.
     "profiles/fuzz/b2a_no_clut.icc",  // oss-fuzz:33396
-#endif
 
     // Caused skcms_PolyTF fit to round trip indices outside the range of int.
     "profiles/fuzz/infinite_roundtrip.icc",           // oss-fuzz:8101