fixed "nan" issue

- https://bitcointalk.org/index.php?topic=28402.msg9170949#msg9170949