You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: math/README.md
+2-3Lines changed: 2 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,16 +24,15 @@
24
24
25
25
-**LCM**: Finds the least common multiple (LCM) of two integers.
26
26
27
-
-**Sqrt**: Finds square root of the given number. Works for both integers and floating-point numbers. If the input is negative, it returns the initial given number.
28
-
+**Sqrt**: Finds the square root of the given number. Works for both integers and floating-point numbers. If the input is negative, it returns an error along with the original negative number.
27
+
-**Sqrt**: Finds the square root of the given number. Works for both integers and floating-point numbers. If the input is negative, it returns an error along with the original negative number.
29
28
30
29
-**IsPrime**: Checks if a number is prime or not. Only works for non-negative integers.
31
30
32
31
-**PrimeList**: Returns a slice of prime numbers up to n.
33
32
34
33
-**GetDivisors**: Returns the divisors of a positive integer as an unordered slice. Returns an empty slice for negative inputs.
35
34
36
-
35
+
-**RoundDecimalPlaces**: Rounds a float64 to the specified number of decimal places using `math.Round` (half away from zero). Negative values for `places` are clamped to `0` (i.e., rounds to a whole number).
0 commit comments