Method sin
sin(UInt32, Boolean)
Replaces the value on top of the stack with the sine or cosine of that value.
The value interpreted as an angle is measured in radians.
Declaration
public void sin(uint c, bool cos)
Parameters
Type | Name | Description |
---|---|---|
System.UInt32 | c | The desired precision. |
System.Boolean | cos | If true, the cosine is calculated, otherwise the sine. |
Remarks
The desired precision is controlled by the parameter c
where c
represents a break criteria of the internal iteration.
For a desired precesission of decimal digits c
can be calculated as:
msb(pow(10, digits))
or
(uint)Math.Ceiling(digits * 3.321928094887362) // * (log(2) + log(5)) / log(2))
.
The result however has to be rounded explicitely to get an exact decimal representation.