Menu Close

Go – How to get the order-one Bessel function of the second kind in go

Here, We will learn how to get the order-one Bessel function of the second kind in go. We can get it by using Y1() function in math package in go golang.

Function prototype:

func Y1(x float64) float64

Return value:

Y1() function in math package returns 
the order-one Bessel function of the second kind.

Example with code:

package main

import (
  "fmt"
  "math"
)

func main() {

  no := math.Y1(1.2)
  fmt.Println(no)

  no = math.Y1(-2.7)
  fmt.Println(no)

  no = math.Y1(0.0)
  fmt.Println(no)

  no = math.Y1(-2.9)
  fmt.Println(no)

  no = math.Y1(2)
  fmt.Println(no)
}

Output:

-0.6211363797488479
NaN
-Inf
NaN
-0.10703243154093756

To learn more about golang, Please refer given below link:

https://www.techieindoor.com/go-lang-tutorial/

References:

https://golang.org/doc/
https://golang.org/pkg/
Posted in golang, math

Leave a Reply

Your email address will not be published. Required fields are marked *