MCPcopy
hub / github.com/shopspring/decimal / TestAtan

Function TestAtan

decimal_test.go:3461–3498  ·  view source on GitHub ↗

Trig tests For Atan

(t *testing.T)

Source from the content-addressed store, hash-verified

3459
3460// For Atan
3461func 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
3501func TestSin(t *testing.T) {

Callers

nothing calls this directly

Calls 3

NewFromStringFunction · 0.85
AtanMethod · 0.80
EqualMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…