Describe the bug
Some trig functions can cause a really slow (or maybe endless?) loop.
Steps To Reproduce
- Switch to scientific mode.
- Switch to
RAD mode.
- Type (0-9e9999).
- Click
Trigonometry then sin.
Expected behavior
Either an error, or the correct value of sin(-9 * 10^9999).
Screenshots
Device and Application Information
- OS Build: 10.0.26100.0
- Architecture: X64
- Application Version: 11.2607.0.0
- Region: en-US
- Dev Version Installed: False
Additional context
|
return m_currentVal >= m_maxTrigonometricNum; |
This only checks against a positive bound of 1e100 - negative values totally ignore it.
In conjunction with this, scale2pi at
|
void scale2pi(_Inout_ PRAT* px, uint32_t radix, int32_t precision) |
seems
O(n^3) with
n being the number of digits of the input.
When trying smaller values, it seems to imply the above expression isn't an endless loop but will take about 15 minutes to run while calc is unresponsive. So not sure if this counts as a bug or not, but it seems there is intent to prevent this by blocking positive values above 1e100.
Requested Assignment
I'm just reporting this problem. I don't want to fix it.
Describe the bug
Some trig functions can cause a really slow (or maybe endless?) loop.
Steps To Reproduce
RADmode.Trigonometrythensin.Expected behavior
Either an error, or the correct value of
sin(-9 * 10^9999).Screenshots
Device and Application Information
Additional context
calculator/src/CalcManager/CEngine/scicomm.cpp
Line 1130 in 4fd3fc5
This only checks against a positive bound of 1e100 - negative values totally ignore it.
In conjunction with this,
scale2piatcalculator/src/CalcManager/Ratpack/support.cpp
Line 506 in 4fd3fc5
O(n^3)withnbeing the number of digits of the input.When trying smaller values, it seems to imply the above expression isn't an endless loop but will take about 15 minutes to run while calc is unresponsive. So not sure if this counts as a bug or not, but it seems there is intent to prevent this by blocking positive values above 1e100.
Requested Assignment
I'm just reporting this problem. I don't want to fix it.