From: jzakiya Date: 2009-12-24T09:50:09+09:00 Subject: Re: Trig value errors > > Also, as an example: > > > static VALUE > > math_cos(VALUE obj, VALUE x) > > { > >     Need_Float(x); > >     return DBL2NUM(cos(RFLOAT_VALUE(x))); > > > } > > > If you have a beef with anyone, its with the implementers of the C > > standard library, but... > > Try this (with correct syntax if wrong). > Do similar for sin. > > static VALUE > math_cos(VALUE obj, VALUE x) > { >     Need_Float(x); >     cos_value = DBL2NUM(cos(RFLOAT_VALUE(x))); >     if (abs(cos_value) < 1e-10) cos_value  0.0; >     return cos_value; > } please Excuse the typo: if (abs(cos_value) < 1e-10) cos_value = 0.0;