Math.sincos(x)?

Boris Zbarsky bzbarsky at mit.edu
Thu Jun 22 18:16:21 UTC 2017


On 6/22/17 2:13 PM, Алексей wrote:
> function sincos (a) {
>     const sin = Math.sin(a)
>     const cos = (1 - sin**2)**0.5

This will completely fail for a near pi/2.  It will return zero instead 
of the correct small but nonzero value it should be returning.

-Boris


More information about the es-discuss mailing list