Dear all, I intend to commit the attached obvious patch within 24h unless there are comments. The issue is an off-by-one error in setting up the maximum exponent of the real kind that is passed to mpfr, so that model numbers between huge(x)/2 and huge(x), when given as an argument to NEAREST(arg,-1.0), are rounded down to huge(x)/2 during compile-time simplification. As no such issue is observed at run-time, the testcase compares the compile-time and run-time results for corner cases. Regtested on x86_64-pc-linux-gnu. As this is sort of a wrong-code issue, I intend to backport to all open branches. (The issue was apparently introduced in r0-84566-gb6f63e898498e6 without noticing, so it is technically a regression.) Thanks, Harald