COMP: Use static cast to double, this was done in commit a70a38a7df40868d4aff2fa1d614b7984c3297f0
but somehow got reverted to dynamic cast