public class MathExtensions extends Object
| Constructor and Description |
|---|
MathExtensions() |
| Modifier and Type | Method and Description |
|---|---|
static int[] |
getPrimeNumbers(int quantity)
Gets the prime numbers for the given quantity.
|
static boolean |
isBetween(int min,
int max,
int index)
Checks the given index is between the range from min and max.
|
static boolean |
isInRange(int min,
int max,
int number)
Checks the given number is in range from min and max.
|
static boolean |
isNegative(double number)
Checks if the number is negative.
|
static boolean |
isNegative(int number)
Checks if the number is negative.
|
static boolean |
isNegative(long number)
Checks if the number is negative.
|
static boolean |
isNext(Integer number,
Integer nextNumber)
|
static boolean |
isPositive(double number)
Checks if the number is positive.
|
static boolean |
isPositive(int number)
Checks if the number is positive.
|
static boolean |
isPositive(long number)
Checks if the number is positive.
|
static boolean |
isPrevious(Integer number,
Integer previousNumber)
|
static boolean |
isPrimeNumber(int number)
Checks if the number is a prime number.
|
static int[] |
printAllPrimeNumbersTill(int noOfPrimes)
Prints all prime numbers till the given number.
|
public static int[] getPrimeNumbers(int quantity)
quantity - The quantity.public static boolean isBetween(int min,
int max,
int index)
min - The minimum.max - The maximum.index - The index.public static boolean isInRange(int min,
int max,
int number)
min - The minimum.max - The maximum.number - The index.public static boolean isNegative(double number)
number - The number.public static boolean isNegative(int number)
number - The number.public static boolean isNegative(long number)
number - The number.public static boolean isPositive(double number)
number - The number.public static boolean isPositive(int number)
number - The number.public static boolean isPositive(long number)
number - The number.public static boolean isPrimeNumber(int number)
number - The number.public static int[] printAllPrimeNumbersTill(int noOfPrimes)
noOfPrimes - The limit.Copyright © 2015–2017 Alpha Ro Group UG (haftungsbeschrÀngt). All rights reserved.