Fix issue 12183 : cast to double instead of real to avoid valgrind's abort

https://d.puremagic.com/issues/show_bug.cgi?id=12183