Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
Programming Articles - Page 405 of 3363
244 Views
Golang is a programming language that supports various mathematical functions. One of the functions that Golang supports is the tangent function. The tangent function is used to find the ratio of the opposite side to the adjacent side of a right-angled triangle. In this article, we will discuss how to find the tangent of a specified number in Golang. Syntax The syntax for finding the tangent of a number in Golang is − func Tan(x float64) float64 The Tan function takes a float64 value as an argument and returns a float64 value. Example 1: Finding Tangent of a Number ... Read More
173 Views
In mathematics, the sine function is a trigonometric function that represents the ratio of the length of the side opposite to an angle to the length of the hypotenuse in a right-angled triangle. It is denoted by sin. In Golang, the math package provides the Sin() function that returns the sine value of a given number in radians. Syntax The syntax for finding the sine value of a specified number in Golang is − func Sin(x float64) float64 Where x is the angle in radians. Example 1: Find Sine Value of 0.5 Let's write a program that finds the ... Read More
479 Views
In mathematics, the natural logarithm is the logarithm to the base e, where e is an irrational constant approximately equal to 2.71828. The natural logarithm of a number is a fundamental mathematical function that has many applications, particularly in calculus and statistical analysis. In Go language, the math package provides the function math.Log() to find the natural logarithm of a given number. Syntax func Log(x float64) float64 The function takes a float64 number as input and returns its natural logarithm as a float64 value. Example package main import ( "fmt" "math" ) ... Read More
2K+ Views
In mathematics, the modulo operation is used to determine the remainder of a division operation. In Golang, we can find the modulo of a given number using the % operator. In this article, we will discuss how to find the mod of a given number in Golang. In mathematics, the modulo operation is used to determine the remainder of a division operation. In Golang, we can find the modulo of a given number using the % operator. In this article, we will discuss how to find the mod of a given number in Golang. Finding Mod of Given Number in ... Read More
801 Views
In Go, finding the minimum of two numbers is a straightforward process. In this article, we will discuss the different ways to find the minimum of two numbers in Go. Using if-else Statement One of the simplest ways to find the minimum of two numbers in Go is to use the if-else statement. Here's the code − Example package main import "fmt" func main() { a, b := 42, 24 fmt.Printf("Min of %d and %d is %d", a, b, min(a, b)) } func min(a, b int) int { ... Read More
2K+ Views
In programming, we often need to compare two values and find the maximum of the two. In Golang, we have multiple ways to find the maximum of two numbers. In this article, we will discuss different approaches to find the maximum of two numbers in Golang. Using if-else Statement One of the simplest ways to find the maximum of two numbers in Golang is by using an if-else statement. The logic is straightforward: we check if the first number is greater than the second number, and if it is, we assign the first number to the maximum variable; otherwise, we ... Read More
198 Views
The math.Log1p() function in Golang is used to calculate the natural logarithm of (1 + x) for a given value x. The Log1p() function is useful when x is very small, as the usual formula to calculate the natural logarithm may cause a loss in precision. This function is also known as log(1 + x), where x is a floating-point number. In this article, we will discuss the Log1p() function and its usage in Golang, along with an example. Syntax The syntax for using the math.Log1p() function is as follows − func Log1p(x float64) float64 The function takes one ... Read More
169 Views
In mathematics, the inverse hyperbolic sine function is also known as the area hyperbolic sine function. It is the inverse function of the hyperbolic sine function, and it is used to find the angle that has a hyperbolic sine equal to a given number. In Golang, we can calculate the inverse hyperbolic sine of a specified number using the math.Asinh() function. In this article, we will discuss how to find the inverse hyperbolic sine of a specified number in Golang, along with an example. Using math.Asinh() Function to Find Inverse Hyperbolic Sine The math.Asinh() function in Golang is used to ... Read More
164 Views
Golang is a statically typed, compiled programming language that is popular among developers for its simplicity, concurrency support, and garbage collection. In this article, we will discuss how to find the inverse hyperbolic cosine of a specified number in Golang. The inverse hyperbolic cosine function is used to find the angle whose hyperbolic cosine is equal to a given number. It is denoted as acosh(x), where x is the input value. Golang provides the math package that includes various mathematical functions, including the Inverse Hyperbolic Cosine function. We can use the math.Acosh() function to find the inverse hyperbolic cosine of ... Read More
1K+ Views
In Golang, the math.Floor() function is used to find the largest integer value less than or equal to a given float64 value. The function returns a float64 value. In this article, we will discuss how to find the floor value of a given number in Golang using the math.Floor() function. Syntax The syntax for using the math.Floor() function is as follows − func Floor(x float64) float64 The Floor() function takes a single argument x of type float64 and returns a float64 value. Parameters The Floor() function takes a single parameter x of type float64. This parameter represents the number ... Read More