Fix norm calculation in gmx_spatial
authorJoe Jordan <ejjordan12@gmail.com>
Wed, 27 Oct 2021 10:15:13 +0000 (10:15 +0000)
committerAndrey Alekseenko <al42and@gmail.com>
Wed, 27 Oct 2021 10:15:13 +0000 (10:15 +0000)
commit5227e867887ba713540bad8a7445509742abcae3
tree1687f49f2770be12c2b0c53f6d1e01d06bd0e960
parentb90aec9135f4990347d656d7ab580599589045e7
Fix norm calculation in gmx_spatial

Casting early to a double should avoid underflow in later multiplication.
An assert that the norm is non-negative is added.

Fixes #4184
src/gromacs/gmxana/gmx_spatial.cpp