Improve trigonometric function zero-crossing

This commit is contained in:
Markus Gans 2015-06-22 02:01:50 +02:00
parent e6ac1abda1
commit c6518823c4
1 changed files with 4 additions and 0 deletions

View File

@ -565,6 +565,8 @@ void Calc::cb_buttonClicked (FWidget*, void* data_ptr)
{
if ( arcus_mode )
*x = asin(*x) * 180.0L/PI;
else if ( fmod(*x,180.0L) == 0.0L )
*x = 0.0L;
else
*x = sin(*x * PI/180.0L);
}
@ -595,6 +597,8 @@ void Calc::cb_buttonClicked (FWidget*, void* data_ptr)
{
if ( arcus_mode )
*x = acos(*x) * 180.0L/PI;
else if ( fmod(*x - 90.0L,180.0L) == 0.0L )
*x = 0.0L;
else
*x = cos(*x * PI/180.0L);
}