<table border="1" cellspacing="0" cellpadding="8">
    <tr>
        <th>Issue</th>
        <td>
            <a href=https://github.com/llvm/llvm-project/issues/58473>58473</a>
        </td>
    </tr>

    <tr>
        <th>Summary</th>
        <td>
            False positive in bugprone-narrowing-conversions?
        </td>
    </tr>

    <tr>
      <th>Labels</th>
      <td>
            clang-tidy,
            false-positive
      </td>
    </tr>

    <tr>
      <th>Assignees</th>
      <td>
      </td>
    </tr>

    <tr>
      <th>Reporter</th>
      <td>
          carlosgalvezp
      </td>
    </tr>
</table>

<pre>
    Hi, 

The following code:

```cpp
#include <chrono>

constexpr float kNano{std::nano::den};
```

Leads to:

```
warning: narrowing conversion from constant value 1000000000 of type 'intmax_t' (aka 'long') to 'float' [bugprone-narrowing-conversions,cppcoreguidelines-narrowing-conversions]
```

Repro: https://godbolt.org/z/Gacb7o7TE

However `float` can store large numbers up to 10^38, why would it be a problem to store 10^9?

Thanks!


</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJyFU8FymzAQ_Rpx2bEHRABz4JDEcXPo9NDJvSOkBdTIEiMJO87Xd8F142QmKSOEdlnevvckWqdOzaNm_B5YumXp7Xl-GhA6Z4w7atuDdApZfntdwMr0POQ4_s3wXFtpJoXA8ns5eGcdyx-uP5LOhogvo4fOOBHh-YegmuouRDXD57d2jpeVQsuqLcvvPrS7hvuOQgWI7jNq5_AovCURVARWeH9RZA_og3YWOu_2sDATNsJBmAkhSy8XuA7iaSRNvNI27sXLr0hLCjfiWcxZ4wicV4zXRGVOLNqWmuKunfqRjMDVv9art9aBXCf7pPPYT1qh0RbDJ5XF9gsjfiI1mQUOMY5htoPvaPROtc7EtfNEcPdK9zch28pVT-925dEdkfoAgZ6plylIYSFEIgZG-B7BTvuWqMA0ziKzlBUP-WY-NMfhBEc3GQU6QosggKi0Bvdz3Rlhqa5Zvnt_wIR9JgOy62SCTVaWZVYXVVknqslVndciiToabHbCBITRBR31AUFb-I-5-S6ZvGk-eKLjMLVr6fYUGHO4PFaE9Bsl7dtOhzAhUdsVm5sqT4amUJ1KRS3rTgmauqpTFapCUqqtC1UnRrRoQkP7zTiXRhCRqNWJguW_4rybua8u3Od8sU10w1POszSrszKt-WbdVvKmzWZEpXKhSnaT4l5os54JzruY-GbhSsIDvTQ6xPD2UoSge4u48CB8McXB-UYKb1zohTng65gs4ppF2R-2mTqN">