mirror of https://github.com/oliverbooth/X10D
Delegate (s)byte.IsPrime to short.isPrime
This commit is contained in:
parent
f20aa3dbd4
commit
f0e3b65604
|
@ -50,7 +50,7 @@
|
|||
/// </returns>
|
||||
public static bool IsPrime(this byte value)
|
||||
{
|
||||
return ((int)value).IsPrime();
|
||||
return ((short)value).IsPrime();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
|
@ -1,4 +1,4 @@
|
|||
using System;
|
||||
using System;
|
||||
|
||||
namespace X10D
|
||||
{
|
||||
|
@ -43,41 +43,7 @@ namespace X10D
|
|||
/// </returns>
|
||||
public static bool IsPrime(this sbyte value)
|
||||
{
|
||||
return value switch
|
||||
{
|
||||
2 => true,
|
||||
3 => true,
|
||||
5 => true,
|
||||
7 => true,
|
||||
11 => true,
|
||||
13 => true,
|
||||
17 => true,
|
||||
19 => true,
|
||||
23 => true,
|
||||
29 => true,
|
||||
31 => true,
|
||||
37 => true,
|
||||
41 => true,
|
||||
43 => true,
|
||||
47 => true,
|
||||
53 => true,
|
||||
59 => true,
|
||||
61 => true,
|
||||
67 => true,
|
||||
71 => true,
|
||||
73 => true,
|
||||
79 => true,
|
||||
83 => true,
|
||||
89 => true,
|
||||
97 => true,
|
||||
101 => true,
|
||||
103 => true,
|
||||
107 => true,
|
||||
109 => true,
|
||||
113 => true,
|
||||
127 => true,
|
||||
_ => false
|
||||
};
|
||||
return ((short)value).IsPrime();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
|
Loading…
Reference in New Issue