Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Experiment[Draft]- please do not review #99143

Closed
2 changes: 2 additions & 0 deletions src/coreclr/vm/jitinterface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10697,6 +10697,8 @@ void* CEEJitInfo::getHelperFtn(CorInfoHelpFunc ftnNum, /* IN */
dynamicFtnNum == DYNAMIC_CORINFO_HELP_ULMUL_OVF ||
dynamicFtnNum == DYNAMIC_CORINFO_HELP_ULNG2DBL ||
dynamicFtnNum == DYNAMIC_CORINFO_HELP_DBL2ULNG ||
dynamicFtnNum == DYNAMIC_CORINFO_HELP_DBL2INT ||
dynamicFtnNum == DYNAMIC_CORINFO_HELP_DBL2UINT ||
dynamicFtnNum == DYNAMIC_CORINFO_HELP_DBL2INT_OVF ||
dynamicFtnNum == DYNAMIC_CORINFO_HELP_DBL2UINT_OVF ||
dynamicFtnNum == DYNAMIC_CORINFO_HELP_DBL2LNG_OVF ||
Expand Down
6 changes: 6 additions & 0 deletions src/libraries/System.Private.CoreLib/src/System/Math.cs
Original file line number Diff line number Diff line change
Expand Up @@ -1624,6 +1624,9 @@ private static double ULongToDouble(ulong val)

private static ulong DoubleToULong(double val)
{
if (double.IsNaN(val))
return 0;

const double two63 = 2147483648.0 * 4294967296.0;
ulong ret;
if (val < two63)
Expand Down Expand Up @@ -1735,10 +1738,13 @@ private static double DoubleReminder(double dividend, double divisor)
return FMod(dividend, divisor);
}

[StackTraceHidden]
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we want to hide the stack trace?

private static int DoubleToInt(double val)
{
return double.IsNaN(val) || ((long)val < int.MinValue) ? int.MinValue : ((long)val > int.MaxValue) ? int.MaxValue : (int)(long)val;
}

[StackTraceHidden]
private static uint DoubleToUInt(double val)
{
return double.IsNaN(val) || (val < 0) ? 0 : ((ulong)val > uint.MaxValue) ? uint.MaxValue : (uint)(ulong)val;
Expand Down
Loading