Commit d91ccd8c authored by Steffen Müthing's avatar Steffen Müthing

[!350] Truncate denormalized floating point values to 0 when writing ASCII

Merge branch 'bug/do-not-crash-paraview-on-macos' into 'master'

ref:core/dune-grid Paraview (well, probably VTK) on macOS crashes when reading
ASCII files with denormalized float values. This seems to be due to libc++'s
IO stream implementation, which sets the fail bit when reading a denormalized
value. On top of that, Paraview just segfaults when encountering a fail bit
while loading VTK files.

libstdc++ does not set the failt bit, and I don't know what is the correct
behavior, but having Paraview mysteriously crash on DUNE output files is not
good.

So this patch truncates subnormal floating point values to 0 when writing
ASCII. This should not seriously influence any visualization results, but it
might trip up people who use exact floating point comparisons for tests (but
then you shouldn't do that anyway\...).

See merge request [!350]

  [!350]: gitlab.dune-project.org/core/dune-grid/merge_requests/350
parents 944e2a21 7b8af4fd
Pipeline #20080 passed with stage
in 15 minutes and 16 seconds