Learn and Learn

Learn And Learn - great place for tutorials, references and how-to

GoLang – Find Tangent – Tan() Function – Examples & Explanation

Tan() function is used to find the tangent of the given radian input (x – parameter) in Go language. The standard math package of Go programming language has Tan() function.

Syntax of Tan() Function in Go Language

The syntax of Tan() function in Go Language is:

Note: float64 is a data type in Go language which has IEEE-754 64-bit floating-point numbers.
Special cases are:
Tan(±0) = ±0
Tan(±Inf) = NaN
Tan(NaN) = NaN


Parameters of Tan() Function in Go Language

x – Where x is any Valid float64 Input value. This parameter is required.


Error Handling

If the x parameter is not a number (numeric value) Tan() function returns an error .
If there is no argument (x – input value) passes to the function, then the compiler will produce an error.


Return Value of Tan() Function in Go Language

Tan() function will returns the tangent of the radian argument(x – parameter).


GoLang Tan() Function Example 1



GoLang Tan() Function Example 2



GoLang Tan() Function Example 3



LearnAndLearn.com © 2018 - All rights reserved