<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/57606>57606</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
Wrong float in json ast-dump
</td>
</tr>
<tr>
<th>Labels</th>
<td>
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
kleag
</td>
</tr>
</table>
<pre>
Example program `test/float.h`:
```c
float f = 0.1;
```
Correct (simplified) non json ast dump (`clang -x c++ -Xclang -ast-dump -fsyntax-only test/float.h`):
```
`-FloatingLiteral 0x1e94648 <col:11> 'double' 1.000000e-01
```
Wrong (simplified) json ast dump ( clang -x c++ -Xclang -ast-dump=json -fsyntax-only test/float.h`):
```json
{
"inner": [
{
"id": "0x1511648",
"kind": "FloatingLiteral",
"range": {
"begin": {
"offset": 10,
"col": 11,
"tokLen": 3
},
"end": {
"offset": 10,
"col": 11,
"tokLen": 3
}
},
"type": {
"qualType": "double"
},
"valueCategory": "rvalue",
"value": "0.10000000000000001"
}
]
}
]
}
]
}
```
Float values with more than 1 digit after the decimal point do not show this problem.
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJzNVUtz2yAQ_jXowkgD6GHroENiJ6ccO9NekYQkEiRcQIn977vCcuz6lbanMozELt-y3y6wlLreFU9b3m-UwBujW8N7jDLihHWIPTdKcxd1oEDxAyJrRB6mse_VXvYQ3GAUrzGJKIofz3Cz6L8rbYyoHEZsaSX4lI0UNWI5HvSAXy18uHW4HvvNBJmcKD60ONziCrFH6Dj8MasAGHpg2Njd4Pg21IPa4UviLL_kvhcxNBDC5wksh_ZFOmG4wmRLRZ5kyRKCWlVagT2FwJ6A06LWY6kEDDCNiG8iJPROyN-NBroXAV8Ei78OFVLszf4l4slwVi0ej-HvG2JMDoMw8AdLjNILBGAuzQ6m9cGOMUhdSimkblKx1Q2LNzmc2Jyl_66lgYSIg-l1Rh5XilYOX-E8UjeNFW6GUnLD9QyeDsOMpPeRTr-9iAOD-AbPxfrmImApjkn6nyO4tlE3A5vW3W3-ZAd_jlx9O4Eydrh67K9dvnM1ihV3otVmd1zQeP3d8_aJmI93RMnvjV7lcyUvKD1TnWF-mz-Z-9R_6q6WGX-JsKdr8Yd0He61Edh1fMAU17KVDvMGLhioBK5FJXuodBstByhBGuqvw7bTHzAr7fQQQKb76NRBIAqaZSxN05gkQV3EdR7nPHDSKVHsi9z-KZDHSu6rVjAaVXTObexUldgzdCDTjWVU6R4Epd4PvxAcv8L7AKK0FiKBQbrISBZ0hVhQnpdJlaUN5WXDE1KndTmpOMtoQwPFS6FsMRWvdB3IghHYr5wsKHAmcUTrOK_JMlmyNM_TkqOEiJ5LFU2OI23awBSeQzm2FiaVtM4eJ7m1sh2EOKzPR9dpU7wpwdvAky0801_Yh9lI">