| 144 | } |
| 145 | |
| 146 | inline |
| 147 | double |
| 148 | dec_to_float( |
| 149 | std::uint64_t m, |
| 150 | std::int32_t e, |
| 151 | bool neg) noexcept |
| 152 | { |
| 153 | // convert to double explicitly to silence warnings |
| 154 | double x = static_cast<double>(m); |
| 155 | if(neg) |
| 156 | x = -x; |
| 157 | |
| 158 | if(e < -305) |
| 159 | { |
| 160 | x *= 1e-305 ; |
| 161 | e += 305; |
| 162 | } |
| 163 | |
| 164 | if(e >= -22 && e < 0) |
| 165 | return x / pow10(-e); |
| 166 | |
| 167 | return x * pow10(e); |
| 168 | } |
| 169 | |
| 170 | inline |
| 171 | bool |