Trig tests For Atan
(t *testing.T)
| 3459 | |
| 3460 | // For Atan |
| 3461 | func TestAtan(t *testing.T) { |
| 3462 | inps := []string{ |
| 3463 | "-2.91919191919191919", |
| 3464 | "-1.0", |
| 3465 | "-0.25", |
| 3466 | "0.0", |
| 3467 | "0.33", |
| 3468 | "1.0", |
| 3469 | "5.0", |
| 3470 | "10", |
| 3471 | "11000020.2407442310156021090304691671842603586882014729198302312846062338790031898128063403419218957424", |
| 3472 | } |
| 3473 | sols := []string{ |
| 3474 | "-1.24076438822058001027437062753106", |
| 3475 | "-0.78539816339744833061616997868383", |
| 3476 | "-0.24497866312686415", |
| 3477 | "0.0", |
| 3478 | "0.318747560420644443", |
| 3479 | "0.78539816339744833061616997868383", |
| 3480 | "1.37340076694501580123233995736766", |
| 3481 | "1.47112767430373453123233995736766", |
| 3482 | "1.57079623588597296123259450235374", |
| 3483 | } |
| 3484 | for i, inp := range inps { |
| 3485 | d, err := NewFromString(inp) |
| 3486 | if err != nil { |
| 3487 | t.FailNow() |
| 3488 | } |
| 3489 | s, err := NewFromString(sols[i]) |
| 3490 | if err != nil { |
| 3491 | t.FailNow() |
| 3492 | } |
| 3493 | a := d.Atan() |
| 3494 | if !a.Equal(s) { |
| 3495 | t.Errorf("expected %s, got %s", s, a) |
| 3496 | } |
| 3497 | } |
| 3498 | } |
| 3499 | |
| 3500 | // For Sin |
| 3501 | func TestSin(t *testing.T) { |
nothing calls this directly
no test coverage detected
searching dependent graphs…