diff options
author | Matt Turner <[email protected]> | 2013-11-25 22:18:28 -0800 |
---|---|---|
committer | Matt Turner <[email protected]> | 2013-12-04 20:05:43 -0800 |
commit | 4b0ef4bf38f84af33000cd70a01d6df8b14afee9 (patch) | |
tree | dc81936a07f889072ca9d408c6750ed00bdf55b7 /src | |
parent | 8814806c97ed60c5bb4d6cb1927cd05445864388 (diff) |
glsl: Use fabs() on floating point values.
Reviewed-by: Kenneth Graunke <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/glsl/ir_print_visitor.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/glsl/ir_print_visitor.cpp b/src/glsl/ir_print_visitor.cpp index f85e573c43e..6ad22fe33e8 100644 --- a/src/glsl/ir_print_visitor.cpp +++ b/src/glsl/ir_print_visitor.cpp @@ -416,9 +416,9 @@ void ir_print_visitor::visit(ir_constant *ir) if (ir->value.f[i] == 0.0f) /* 0.0 == -0.0, so print with %f to get the proper sign. */ printf("%.1f", ir->value.f[i]); - else if (abs(ir->value.f[i]) < 0.000001f) + else if (fabs(ir->value.f[i]) < 0.000001f) printf("%a", ir->value.f[i]); - else if (abs(ir->value.f[i]) > 1000000.0f) + else if (fabs(ir->value.f[i]) > 1000000.0f) printf("%e", ir->value.f[i]); else printf("%f", ir->value.f[i]); |