<table border="1" cellspacing="0" cellpadding="8">
<tr>
<th>Issue</th>
<td>
<a href=https://github.com/llvm/llvm-project/issues/76326>76326</a>
</td>
</tr>
<tr>
<th>Summary</th>
<td>
[Flang] FRACTION of +/- Inf, REAL and DOUBLE PRECISION, returns NaN instead of +/- Inf
</td>
</tr>
<tr>
<th>Labels</th>
<td>
flang
</td>
</tr>
<tr>
<th>Assignees</th>
<td>
</td>
</tr>
<tr>
<th>Reporter</th>
<td>
chandankds
</td>
</tr>
</table>
<pre>
The intrinsic FRACTION should return Inf, not NaN, for Inf argument.
The Intel compiler returns Inf, GNU returns NaN.
```
Program test_fraction_inf
Real :: x
Real(Kind(1.d0)) :: y
x = Huge(x) ; y = Huge(y)
Call s(x,y)
Contains
Subroutine s(x,y)
Real :: x
Real(Kind(1.d0)) :: y
x = x + x; y = y + y
Print *, x,y ! expected Inf
Print *, Fraction(x), Fraction(y) ! expected Inf
x = -x ; y = -y
Print *, Fraction(x), Fraction(y) ! expected Inf
End Subroutine s
End Program Test_fraction_inf
```
</pre>
<img width="1px" height="1px" alt="" src="http://email.email.llvm.org/o/eJysU11vmzAU_TXm5SqRcwklPPCQL7ZoVVql7XNlsAFvjh3ZZoJ_P0GgaavuYdIkxMfxuYfj63uYc7LSQqQk2pBoF7DG18amRc00Z_oXd0FueJc-1wKk9lZqJwvITuvt8-HhCK42jeJghW-shoMuCW5BGw9HduxfS2N7FJitmrPQfk7ojtD19d5rHrQXCgpzvkgl7CjkJqVvx5c36MiOH6rJHR2v4fPRmsqyM3jh_GtpWeGl0a9Sl9dlgJNgCki4JuEa2vcgwdUPqTnB1WLOKcGEYDIRu4nYAgl38L2pBMFVe2VsALr3cNfXjvwtUwrclbu9LWyN9kxqN9GemtyaxkstviB_bfkfTE-2WyC4gbZ3fDXcDcDEe7RSeyC47ls-WAAguADRXkThBR9O403yAzsbGz025RPUDab-qnQ1N2vhZmzW_f8f7TX_2OcB79FpZp6_npm3CQt4GvIkTFgg0kVMwyVNVjEGdZovllHJV2VSJGVMYxHlNKJxEWOY8wUTYSBTpBguEJc0wWWIc1FEjJVhWcY8iXi0IksqzkyquVK_z3Njq0A614g0vgvxLlAsF8oN0UQsFdMVQexTatOeP8ubypElVdJ5d1Pw0qshz9lQEe1ueTVlf_IEs9kUsdN-fQ9Mc9g9vGzu9_B42m8PT4eHIb7vsgdSOy8Y_yQRNFaltfcX1w8fZgSzSvq6yeeFORPMelPjY3ax5qcoPMFs2KMjmA3b_BMAAP__pA9Nyg">