MCPcopy Index your code
hub / github.com/koding/kite / Sqrt

Function Sqrt

kite_test.go:511–519  ·  view source on GitHub ↗
(r *Request)

Source from the content-addressed store, hash-verified

509var ErrNegative = errors.New("negative argument")
510
511func Sqrt(r *Request) (interface{}, error) {
512 a := r.Args.One().MustFloat64()
513
514 if a < 0 {
515 return nil, ErrNegative
516 }
517
518 return math.Sqrt(a), nil
519}
520
521// Calls the callback with the result. For testing requests with Callback.
522func SquareCB(r *Request) (interface{}, error) {

Callers

nothing calls this directly

Calls 2

MustFloat64Method · 0.80
OneMethod · 0.80

Tested by

no test coverage detected