Skip to content

Commit 12b311a

Browse files
authored
Create numericvalidator.md
1 parent 01d431d commit 12b311a

File tree

1 file changed

+81
-0
lines changed

1 file changed

+81
-0
lines changed
Lines changed: 81 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,81 @@
1+
# NumericValidator Class
2+
3+
**A static class containing numeric validation methods.**
4+
5+
## Class Members
6+
7+
```csharp
8+
IsPositive<T>(this T input)
9+
```
10+
11+
Determines whether the specified value is positive.
12+
13+
### Type Parameters
14+
15+
- `T`: The type of the input value.
16+
17+
### Returns
18+
19+
- Type: `bool`
20+
- Description: `true` if the specified value is positive; otherwise, `false`.
21+
22+
### Example
23+
24+
```csharp
25+
int positiveNumber = 5;
26+
bool isPositive = positiveNumber.IsPositive(); // Returns true
27+
```
28+
29+
---
30+
31+
```csharp
32+
IsNegative<T>(this T input)
33+
```
34+
35+
Determines whether the specified value is negative.
36+
37+
### Type Parameters
38+
39+
- `T`: The type of the input value.
40+
41+
### Returns
42+
43+
- Type: `bool`
44+
- Description: `true` if the specified value is negative; otherwise, `false`.
45+
46+
### Example
47+
48+
```csharp
49+
int negativeNumber = -3;
50+
bool isNegative = negativeNumber.IsNegative(); // Returns true
51+
```
52+
53+
---
54+
55+
```csharp
56+
IsZero<T>(this T input)
57+
```
58+
59+
Determines whether the specified value is zero.
60+
61+
### Type Parameters
62+
63+
- `T`: The type of the input value.
64+
65+
### Returns
66+
67+
- Type: `bool`
68+
- Description: `true` if the specified value is zero; otherwise, `false`.
69+
70+
### Example
71+
72+
```csharp
73+
int zeroNumber = 0;
74+
bool isZero = zeroNumber.IsZero(); // Returns true
75+
```
76+
77+
---
78+
79+
### Remarks
80+
81+
The `NumericValidator` class also contains several other methods for numeric validation, such as `IsEven`, `IsOdd`, `IsBetween`, and `IsPrime`. These methods provide additional ways to validate numeric values. For more information and examples of how to use these methods, please refer to the API reference documentation.

0 commit comments

Comments
 (0)