Skip to content

Instantly share code, notes, and snippets.

@Y-Less
Created July 31, 2020 13:27
Show Gist options
  • Save Y-Less/f53d5506af4ec488a47e82323dac6796 to your computer and use it in GitHub Desktop.
Save Y-Less/f53d5506af4ec488a47e82323dac6796 to your computer and use it in GitHub Desktop.
Truncated.
using System;
namespace Y_Less
{
public class DivideByNoughtException : ArithmeticException
{
/// <summary>
/// Initializes a new instance of the Y_Less.DivideByNoughtException class.
/// </summary>
public DivideByNoughtException()
: base()
{
}
/// <summary>
/// Initializes a new instance of the Y_Less.DivideByNoughtException class with a specified error message.
/// </summary>
/// <param name="message">
/// A System.String that describes the error.
/// </param>
public DivideByNoughtException(string message)
: base(message)
{
}
/// <summary>
/// Initializes a new instance of the Y_Less.DivideByNoughtException class with a specified error message and a reference to the inner exception that is the cause of this exception.
/// </summary>
/// <param name="message">
/// The error message that explains the reason for the exception.
/// </param>
/// <param name="innerException">
/// The exception that is the cause of the current exception. If the innerException parameter is not null, the current exception is raised in a catch block that handles the inner exception.
///</param>
public DivideByNoughtException(string message, Exception innerException)
: base(message, innerException)
{
}
/// <summary>
/// Initializes a new instance of the Y_Less.DivideByNoughtException class with serialized data.
/// </summary>
/// <param name="info">
/// The object that holds the serialized object data.
/// </param>
/// <param name="context">
/// The contextual information about the source or destination.
/// </param>
protected DivideByNoughtException(SerializationInfo info, StreamingContext context)
: base(info, context)
{
}
}
public static class Maths
{
/// <summary>
/// Perform an inverse multiply, catching problems and renaming them correctly.
/// </summary>
/// <param name="topNumber">
/// result = top <- This one
/// ------
/// bottom
/// </param>
/// <param name="numberBelow">
/// result = top
/// ------
/// bottom <- This one
/// </param>
/// <returns>
/// A number.
/// </returns>
public static int TryToDoADivisionPlease(int topNumber, int numberBelow)
{
try
{
return topNumber / numberBelow;
}
catch (DivideByZeroException e)
{
throw new DivideByNoughtException(e.Message, e.InnerException);
}
}
/// <summary>
/// Checks if a given number is an integer less than 1, but greater than -1.
/// </summary>
/// <param name="number">
/// The variable holding the number whose noughtness you want to investigate.
/// </param>
/// <returns>
/// If the input is one of the numbers not nought (for example `42`, `101`, `-7`, etc) this function will return `false` because it is not true that the number that isn't nought is nought. However, if it transpires that the given input does infact equal the number that the ancient Babylonians didn't know existed (idiots) then this function will return `true`.
/// </returns>
public static bool IsNought(int number)
{
try
{
// https://en.wikipedia.org/wiki/Fast_inverse_square_root
_ = TryToDoADivisionPlease(0x5F3759DF, number);
}
catch (DivideByNoughtException)
{
return true;
}
return false;
}
// Invalid cache state for lazy initialisation.
private static bool lastResult_ = true;
private static int lastNumber_ = 1;
/// <summary>
/// A function to determine if the parity of a number is not in the set of odd parity numbers.
/// </summary>
/// <param name="number">
/// The variable holding the number whose evenness you want to investigate.
/// </param>
/// <returns>
/// `true` when the input is not of the form `2k+1`, `false` when it is.
/// </returns>
public static bool IsEven(int number)
{
// Check if the cache is initialised.
if (lastResult_ == true && lastNumber_ == 1)
{
throw new ArgumentException("Cannot call `IsEven` with `1` first - choose a different number (how about `12`).");
}
// Optimisation: This is a common number.
if (IsNought(number)) return true;
// Optimisation: Cache the last number checked for efficiency.
if (number != lastNumber_)
{
try
{
lastResult_ = IsEvenInternal(number);
}
catch (ArgumentOutOfRangeException e)
{
// Try again with a smaller number.
string whole = String.Format("{0}", number);
string part = whole.Substring(1);
if (Int32.TryParse(part, out int number2))
{
lastResult_ = IsEven(number2);
}
else
{
throw e;
}
}
lastNumber_ = number;
}
return lastResult_;
}
private static bool IsEvenInternal(int number)
{
if (number == -65536) return true;
if (number == -65535) return false;
if (number == -65534) return true;
if (number == -65533) return false;
if (number == -65532) return true;
if (number == -65531) return false;
if (number == -65530) return true;
if (number == -65529) return false;
if (number == -65528) return true;
if (number == -65527) return false;
if (number == -65526) return true;
if (number == -65525) return false;
if (number == -65524) return true;
if (number == -65523) return false;
if (number == -65522) return true;
if (number == -65521) return false;
if (number == -65520) return true;
if (number == -65519) return false;
if (number == -65518) return true;
if (number == -65517) return false;
if (number == -65516) return true;
if (number == -65515) return false;
if (number == -65514) return true;
if (number == -65513) return false;
if (number == -65512) return true;
if (number == -65511) return false;
if (number == -65510) return true;
if (number == -65509) return false;
if (number == -65508) return true;
if (number == -65507) return false;
if (number == -65506) return true;
if (number == -65505) return false;
if (number == -65504) return true;
if (number == -65503) return false;
if (number == -65502) return true;
if (number == -65501) return false;
if (number == -65500) return true;
if (number == -65499) return false;
if (number == -65498) return true;
if (number == -65497) return false;
if (number == -65496) return true;
if (number == -65495) return false;
if (number == -65494) return true;
if (number == -65493) return false;
if (number == -65492) return true;
if (number == -65491) return false;
if (number == -65490) return true;
if (number == -65489) return false;
if (number == -65488) return true;
if (number == -65487) return false;
if (number == -65486) return true;
if (number == -65485) return false;
if (number == -65484) return true;
if (number == -65483) return false;
if (number == -65482) return true;
if (number == -65481) return false;
if (number == -65480) return true;
if (number == -65479) return false;
if (number == -65478) return true;
if (number == -65477) return false;
if (number == -65476) return true;
if (number == -65475) return false;
if (number == -65474) return true;
if (number == -65473) return false;
if (number == -65472) return true;
if (number == -65471) return false;
if (number == -65470) return true;
if (number == -65469) return false;
if (number == -65468) return true;
if (number == -65467) return false;
if (number == -65466) return true;
if (number == -65465) return false;
if (number == -65464) return true;
if (number == -65463) return false;
if (number == -65462) return true;
if (number == -65461) return false;
if (number == -65460) return true;
if (number == -65459) return false;
if (number == -65458) return true;
if (number == -65457) return false;
if (number == -65456) return true;
if (number == -65455) return false;
if (number == -65454) return true;
if (number == -65453) return false;
if (number == -65452) return true;
if (number == -65451) return false;
if (number == -65450) return true;
if (number == -65449) return false;
if (number == -65448) return true;
if (number == -65447) return false;
if (number == -65446) return true;
if (number == -65445) return false;
if (number == -65444) return true;
if (number == -65443) return false;
if (number == -65442) return true;
if (number == -65441) return false;
if (number == -65440) return true;
if (number == -65439) return false;
if (number == -65438) return true;
if (number == -65437) return false;
if (number == -65436) return true;
if (number == -65435) return false;
if (number == -65434) return true;
if (number == -65433) return false;
if (number == -65432) return true;
if (number == -65431) return false;
if (number == -65430) return true;
if (number == -65429) return false;
if (number == -65428) return true;
if (number == -65427) return false;
if (number == -65426) return true;
if (number == -65425) return false;
if (number == -65424) return true;
if (number == -65423) return false;
if (number == -65422) return true;
if (number == -65421) return false;
if (number == -65420) return true;
// ...
if (number == -285) return false;
if (number == -284) return true;
if (number == -283) return false;
if (number == -282) return true;
if (number == -281) return false;
if (number == -280) return true;
if (number == -279) return false;
if (number == -278) return true;
if (number == -277) return false;
if (number == -276) return true;
if (number == -275) return false;
if (number == -274) return true;
if (number == -273) return false;
if (number == -272) return true;
if (number == -271) return false;
if (number == -270) return true;
if (number == -269) return false;
if (number == -268) return true;
if (number == -267) return false;
if (number == -266) return true;
if (number == -265) return false;
if (number == -264) return true;
if (number == -263) return false;
if (number == -262) return true;
if (number == -261) return false;
if (number == -260) return true;
if (number == -259) return false;
if (number == -258) return true;
if (number == -257) return false;
if (number == -256) return true;
if (number == -255) return false;
if (number == -254) return true;
if (number == -253) return false;
if (number == -252) return true;
if (number == -251) return false;
if (number == -250) return true;
if (number == -249) return false;
if (number == -248) return true;
if (number == -247) return false;
if (number == -246) return true;
if (number == -245) return false;
if (number == -244) return true;
if (number == -243) return false;
if (number == -242) return true;
if (number == -241) return false;
if (number == -240) return true;
if (number == -239) return false;
if (number == -238) return true;
if (number == -237) return false;
if (number == -236) return true;
if (number == -235) return false;
if (number == -234) return true;
if (number == -233) return false;
if (number == -232) return true;
if (number == -231) return false;
if (number == -230) return true;
if (number == -229) return false;
if (number == -228) return true;
if (number == -227) return false;
if (number == -226) return true;
if (number == -225) return false;
if (number == -224) return true;
if (number == -223) return false;
if (number == -222) return true;
if (number == -221) return false;
if (number == -220) return true;
if (number == -219) return false;
if (number == -218) return true;
if (number == -217) return false;
if (number == -216) return true;
if (number == -215) return false;
if (number == -214) return true;
if (number == -213) return false;
if (number == -212) return true;
if (number == -211) return false;
if (number == -210) return true;
if (number == -209) return false;
if (number == -208) return true;
if (number == -207) return false;
if (number == -206) return true;
if (number == -205) return false;
if (number == -204) return true;
if (number == -203) return false;
if (number == -202) return true;
if (number == -201) return false;
if (number == -200) return true;
if (number == -199) return false;
if (number == -198) return true;
if (number == -197) return false;
if (number == -196) return true;
if (number == -195) return false;
if (number == -194) return true;
if (number == -193) return false;
if (number == -192) return true;
if (number == -191) return false;
if (number == -190) return true;
if (number == -189) return false;
if (number == -188) return true;
if (number == -187) return false;
if (number == -186) return true;
if (number == -185) return false;
if (number == -184) return true;
if (number == -183) return false;
if (number == -182) return true;
if (number == -181) return false;
if (number == -180) return true;
if (number == -179) return false;
if (number == -178) return true;
if (number == -177) return false;
if (number == -176) return true;
if (number == -175) return false;
if (number == -174) return true;
if (number == -173) return false;
if (number == -172) return true;
if (number == -171) return false;
if (number == -170) return true;
if (number == -169) return false;
if (number == -168) return true;
if (number == -167) return false;
if (number == -166) return true;
if (number == -165) return false;
if (number == -164) return true;
if (number == -163) return false;
if (number == -162) return true;
if (number == -161) return false;
if (number == -160) return true;
if (number == -159) return false;
if (number == -158) return true;
if (number == -157) return false;
if (number == -156) return true;
if (number == -155) return false;
if (number == -154) return true;
if (number == -153) return false;
if (number == -152) return true;
if (number == -151) return false;
if (number == -150) return true;
if (number == -149) return false;
if (number == -148) return true;
if (number == -147) return false;
if (number == -146) return true;
if (number == -145) return false;
if (number == -144) return true;
if (number == -143) return false;
if (number == -142) return true;
if (number == -141) return false;
if (number == -140) return true;
if (number == -139) return false;
if (number == -138) return true;
if (number == -137) return false;
if (number == -136) return true;
if (number == -135) return false;
if (number == -134) return true;
if (number == -133) return false;
if (number == -132) return true;
if (number == -131) return false;
if (number == -130) return true;
if (number == -129) return false;
if (number == -128) return true;
if (number == -127) return false;
if (number == -126) return true;
if (number == -125) return false;
if (number == -124) return true;
if (number == -123) return false;
if (number == -122) return true;
if (number == -121) return false;
if (number == -120) return true;
if (number == -119) return false;
if (number == -118) return true;
if (number == -117) return false;
if (number == -116) return true;
if (number == -115) return false;
if (number == -114) return true;
if (number == -113) return false;
if (number == -112) return true;
if (number == -111) return false;
if (number == -110) return true;
if (number == -109) return false;
if (number == -108) return true;
if (number == -107) return false;
if (number == -106) return true;
if (number == -105) return false;
if (number == -104) return true;
if (number == -103) return false;
if (number == -102) return true;
if (number == -101) return false;
if (number == -100) return true;
if (number == -99) return false;
if (number == -98) return true;
if (number == -97) return false;
if (number == -96) return true;
if (number == -95) return false;
if (number == -94) return true;
if (number == -93) return false;
if (number == -92) return true;
if (number == -91) return false;
if (number == -90) return true;
if (number == -89) return false;
if (number == -88) return true;
if (number == -87) return false;
if (number == -86) return true;
if (number == -85) return false;
if (number == -84) return true;
if (number == -83) return false;
if (number == -82) return true;
if (number == -81) return false;
if (number == -80) return true;
if (number == -79) return false;
if (number == -78) return true;
if (number == -77) return false;
if (number == -76) return true;
if (number == -75) return false;
if (number == -74) return true;
if (number == -73) return false;
if (number == -72) return true;
if (number == -71) return false;
if (number == -70) return true;
if (number == -69) return false;
if (number == -68) return true;
if (number == -67) return false;
if (number == -66) return true;
if (number == -65) return false;
if (number == -64) return true;
if (number == -63) return false;
if (number == -62) return true;
if (number == -61) return false;
if (number == -60) return true;
if (number == -59) return false;
if (number == -58) return true;
if (number == -57) return false;
if (number == -56) return true;
if (number == -55) return false;
if (number == -54) return true;
if (number == -53) return false;
if (number == -52) return true;
if (number == -51) return false;
if (number == -50) return true;
if (number == -49) return false;
if (number == -48) return true;
if (number == -47) return false;
if (number == -46) return true;
if (number == -45) return false;
if (number == -44) return true;
if (number == -43) return false;
if (number == -42) return true;
if (number == -41) return false;
if (number == -40) return true;
if (number == -39) return false;
if (number == -38) return true;
if (number == -37) return false;
if (number == -36) return true;
if (number == -35) return false;
if (number == -34) return true;
if (number == -33) return false;
if (number == -32) return true;
if (number == -31) return false;
if (number == -30) return true;
if (number == -29) return false;
if (number == -28) return true;
if (number == -27) return false;
if (number == -26) return true;
if (number == -25) return false;
if (number == -24) return true;
if (number == -23) return false;
if (number == -22) return true;
if (number == -21) return false;
if (number == -20) return true;
if (number == -19) return false;
if (number == -18) return true;
if (number == -17) return false;
if (number == -16) return true;
if (number == -15) return false;
if (number == -14) return true;
if (number == -13) return false;
if (number == -12) return true;
if (number == -11) return false;
if (number == -10) return true;
if (number == -9) return false;
if (number == -8) return true;
if (number == -7) return false;
if (number == -6) return true;
if (number == -5) return false;
if (number == -4) return true;
if (number == -3) return false;
if (number == -2) return true;
if (number == -1) return false;
if (number == 0) return true;
if (number == 1) return false;
if (number == 2) return true;
if (number == 3) return false;
if (number == 4) return true;
if (number == 5) return false;
if (number == 6) return true;
if (number == 7) return false;
if (number == 8) return true;
if (number == 9) return false;
if (number == 10) return true;
if (number == 11) return false;
if (number == 12) return true;
if (number == 13) return false;
if (number == 14) return true;
if (number == 15) return false;
if (number == 16) return true;
if (number == 17) return false;
if (number == 18) return true;
if (number == 19) return false;
if (number == 20) return true;
if (number == 21) return false;
if (number == 22) return true;
if (number == 23) return false;
if (number == 24) return true;
if (number == 25) return false;
if (number == 26) return true;
if (number == 27) return false;
if (number == 28) return true;
if (number == 29) return false;
if (number == 30) return true;
if (number == 31) return false;
if (number == 32) return true;
if (number == 33) return false;
if (number == 34) return true;
if (number == 35) return false;
if (number == 36) return true;
if (number == 37) return false;
if (number == 38) return true;
if (number == 39) return false;
if (number == 40) return true;
if (number == 41) return false;
if (number == 42) return true;
if (number == 43) return false;
if (number == 44) return true;
if (number == 45) return false;
if (number == 46) return true;
if (number == 47) return false;
if (number == 48) return true;
if (number == 49) return false;
if (number == 50) return true;
if (number == 51) return false;
if (number == 52) return true;
if (number == 53) return false;
if (number == 54) return true;
if (number == 55) return false;
if (number == 56) return true;
if (number == 57) return false;
if (number == 58) return true;
if (number == 59) return false;
if (number == 60) return true;
if (number == 61) return false;
if (number == 62) return true;
if (number == 63) return false;
if (number == 64) return true;
if (number == 65) return false;
if (number == 66) return true;
if (number == 67) return false;
if (number == 68) return true;
if (number == 69) return false;
if (number == 70) return true;
if (number == 71) return false;
if (number == 72) return true;
if (number == 73) return false;
if (number == 74) return true;
if (number == 75) return false;
if (number == 76) return true;
if (number == 77) return false;
if (number == 78) return true;
if (number == 79) return false;
if (number == 80) return true;
if (number == 81) return false;
if (number == 82) return true;
if (number == 83) return false;
if (number == 84) return true;
if (number == 85) return false;
if (number == 86) return true;
if (number == 87) return false;
if (number == 88) return true;
if (number == 89) return false;
if (number == 90) return true;
if (number == 91) return false;
if (number == 92) return true;
if (number == 93) return false;
if (number == 94) return true;
if (number == 95) return false;
if (number == 96) return true;
if (number == 97) return false;
if (number == 98) return true;
if (number == 99) return false;
if (number == 100) return true;
if (number == 101) return false;
if (number == 102) return true;
if (number == 103) return false;
if (number == 104) return true;
if (number == 105) return false;
if (number == 106) return true;
if (number == 107) return false;
if (number == 108) return true;
if (number == 109) return false;
if (number == 110) return true;
if (number == 111) return false;
if (number == 112) return true;
if (number == 113) return false;
if (number == 114) return true;
if (number == 115) return false;
if (number == 116) return true;
if (number == 117) return false;
if (number == 118) return true;
if (number == 119) return false;
if (number == 120) return true;
if (number == 121) return false;
if (number == 122) return true;
if (number == 123) return false;
if (number == 124) return true;
if (number == 125) return false;
if (number == 126) return true;
if (number == 127) return false;
if (number == 128) return true;
if (number == 129) return false;
if (number == 130) return true;
if (number == 131) return false;
if (number == 132) return true;
if (number == 133) return false;
if (number == 134) return true;
if (number == 135) return false;
if (number == 136) return true;
if (number == 137) return false;
if (number == 138) return true;
if (number == 139) return false;
if (number == 140) return true;
if (number == 141) return false;
if (number == 142) return true;
if (number == 143) return false;
if (number == 144) return true;
if (number == 145) return false;
if (number == 146) return true;
if (number == 147) return false;
if (number == 148) return true;
if (number == 149) return false;
if (number == 150) return true;
if (number == 151) return false;
if (number == 152) return true;
if (number == 153) return false;
if (number == 154) return true;
if (number == 155) return false;
if (number == 156) return true;
if (number == 157) return false;
if (number == 158) return true;
if (number == 159) return false;
if (number == 160) return true;
if (number == 161) return false;
if (number == 162) return true;
if (number == 163) return false;
if (number == 164) return true;
if (number == 165) return false;
if (number == 166) return true;
if (number == 167) return false;
if (number == 168) return true;
if (number == 169) return false;
if (number == 170) return true;
if (number == 171) return false;
if (number == 172) return true;
if (number == 173) return false;
if (number == 174) return true;
if (number == 175) return false;
if (number == 176) return true;
if (number == 177) return false;
if (number == 178) return true;
if (number == 179) return false;
if (number == 180) return true;
if (number == 181) return false;
if (number == 182) return true;
if (number == 183) return false;
if (number == 184) return true;
if (number == 185) return false;
if (number == 186) return true;
if (number == 187) return false;
if (number == 188) return true;
if (number == 189) return false;
if (number == 190) return true;
if (number == 191) return false;
if (number == 192) return true;
if (number == 193) return false;
if (number == 194) return true;
if (number == 195) return false;
if (number == 196) return true;
if (number == 197) return false;
if (number == 198) return true;
if (number == 199) return false;
if (number == 200) return true;
if (number == 201) return false;
if (number == 202) return true;
if (number == 203) return false;
if (number == 204) return true;
if (number == 205) return false;
if (number == 206) return true;
if (number == 207) return false;
if (number == 208) return true;
if (number == 209) return false;
if (number == 210) return true;
if (number == 211) return false;
if (number == 212) return true;
if (number == 213) return false;
if (number == 214) return true;
if (number == 215) return false;
if (number == 216) return true;
if (number == 217) return false;
if (number == 218) return true;
if (number == 219) return false;
if (number == 220) return true;
if (number == 221) return false;
if (number == 222) return true;
if (number == 223) return false;
if (number == 224) return true;
if (number == 225) return false;
if (number == 226) return true;
if (number == 227) return false;
if (number == 228) return true;
if (number == 229) return false;
if (number == 230) return true;
if (number == 231) return false;
if (number == 232) return true;
if (number == 233) return false;
if (number == 234) return true;
if (number == 235) return false;
if (number == 236) return true;
if (number == 237) return false;
if (number == 238) return true;
if (number == 239) return false;
if (number == 240) return true;
if (number == 241) return false;
if (number == 242) return true;
if (number == 243) return false;
if (number == 244) return true;
if (number == 245) return false;
if (number == 246) return true;
if (number == 247) return false;
if (number == 248) return true;
if (number == 249) return false;
if (number == 250) return true;
if (number == 251) return false;
if (number == 252) return true;
if (number == 253) return false;
if (number == 254) return true;
if (number == 255) return false;
if (number == 256) return true;
if (number == 257) return false;
if (number == 258) return true;
if (number == 259) return false;
if (number == 260) return true;
if (number == 261) return false;
if (number == 262) return true;
if (number == 263) return false;
if (number == 264) return true;
if (number == 265) return false;
if (number == 266) return true;
if (number == 267) return false;
if (number == 268) return true;
if (number == 269) return false;
if (number == 270) return true;
if (number == 271) return false;
if (number == 272) return true;
if (number == 273) return false;
if (number == 274) return true;
if (number == 275) return false;
if (number == 276) return true;
if (number == 277) return false;
if (number == 278) return true;
if (number == 279) return false;
if (number == 280) return true;
if (number == 281) return false;
if (number == 282) return true;
if (number == 283) return false;
if (number == 284) return true;
if (number == 285) return false;
if (number == 286) return true;
if (number == 287) return false;
if (number == 288) return true;
if (number == 289) return false;
if (number == 290) return true;
if (number == 291) return false;
if (number == 292) return true;
if (number == 293) return false;
if (number == 294) return true;
if (number == 295) return false;
if (number == 296) return true;
if (number == 297) return false;
if (number == 298) return true;
if (number == 299) return false;
if (number == 300) return true;
if (number == 301) return false;
if (number == 302) return true;
if (number == 303) return false;
if (number == 304) return true;
if (number == 305) return false;
if (number == 306) return true;
if (number == 307) return false;
if (number == 308) return true;
if (number == 309) return false;
if (number == 310) return true;
if (number == 311) return false;
if (number == 312) return true;
if (number == 313) return false;
if (number == 314) return true;
if (number == 315) return false;
if (number == 316) return true;
if (number == 317) return false;
if (number == 318) return true;
if (number == 319) return false;
if (number == 320) return true;
if (number == 321) return false;
if (number == 322) return true;
if (number == 323) return false;
if (number == 324) return true;
if (number == 325) return false;
if (number == 326) return true;
if (number == 327) return false;
if (number == 328) return true;
if (number == 329) return false;
if (number == 330) return true;
if (number == 331) return false;
if (number == 332) return true;
if (number == 333) return false;
if (number == 334) return true;
if (number == 335) return false;
if (number == 336) return true;
if (number == 337) return false;
if (number == 338) return true;
if (number == 339) return false;
if (number == 340) return true;
if (number == 341) return false;
if (number == 342) return true;
if (number == 343) return false;
if (number == 344) return true;
if (number == 345) return false;
if (number == 346) return true;
if (number == 347) return false;
if (number == 348) return true;
if (number == 349) return false;
if (number == 350) return true;
if (number == 351) return false;
if (number == 352) return true;
if (number == 353) return false;
if (number == 354) return true;
if (number == 355) return false;
if (number == 356) return true;
if (number == 357) return false;
if (number == 358) return true;
if (number == 359) return false;
if (number == 360) return true;
if (number == 361) return false;
if (number == 362) return true;
if (number == 363) return false;
if (number == 364) return true;
if (number == 365) return false;
if (number == 366) return true;
if (number == 367) return false;
if (number == 368) return true;
if (number == 369) return false;
if (number == 370) return true;
if (number == 371) return false;
if (number == 372) return true;
if (number == 373) return false;
if (number == 374) return true;
if (number == 375) return false;
if (number == 376) return true;
if (number == 377) return false;
if (number == 378) return true;
if (number == 379) return false;
if (number == 380) return true;
if (number == 381) return false;
if (number == 382) return true;
if (number == 383) return false;
if (number == 384) return true;
if (number == 385) return false;
if (number == 386) return true;
if (number == 387) return false;
if (number == 388) return true;
if (number == 389) return false;
if (number == 390) return true;
if (number == 391) return false;
if (number == 392) return true;
if (number == 393) return false;
if (number == 394) return true;
if (number == 395) return false;
if (number == 396) return true;
if (number == 397) return false;
if (number == 398) return true;
if (number == 399) return false;
if (number == 400) return true;
if (number == 401) return false;
if (number == 402) return true;
if (number == 403) return false;
if (number == 404) return true;
if (number == 405) return false;
if (number == 406) return true;
if (number == 407) return false;
if (number == 408) return true;
if (number == 409) return false;
if (number == 410) return true;
if (number == 411) return false;
if (number == 412) return true;
if (number == 413) return false;
if (number == 414) return true;
if (number == 415) return false;
if (number == 416) return true;
if (number == 417) return false;
if (number == 418) return true;
if (number == 419) return false;
if (number == 420) return true;
if (number == 421) return false;
if (number == 422) return true;
if (number == 423) return false;
if (number == 424) return true;
if (number == 425) return false;
if (number == 426) return true;
if (number == 427) return false;
if (number == 428) return true;
if (number == 429) return false;
if (number == 430) return true;
if (number == 431) return false;
if (number == 432) return true;
if (number == 433) return false;
if (number == 434) return true;
if (number == 435) return false;
if (number == 436) return true;
if (number == 437) return false;
if (number == 438) return true;
if (number == 439) return false;
if (number == 440) return true;
if (number == 441) return false;
if (number == 442) return true;
if (number == 443) return false;
if (number == 444) return true;
if (number == 445) return false;
if (number == 446) return true;
if (number == 447) return false;
if (number == 448) return true;
if (number == 449) return false;
if (number == 450) return true;
if (number == 451) return false;
if (number == 452) return true;
if (number == 453) return false;
if (number == 454) return true;
if (number == 455) return false;
if (number == 456) return true;
if (number == 457) return false;
if (number == 458) return true;
if (number == 459) return false;
if (number == 460) return true;
if (number == 461) return false;
if (number == 462) return true;
if (number == 463) return false;
if (number == 464) return true;
if (number == 465) return false;
if (number == 466) return true;
if (number == 467) return false;
if (number == 468) return true;
if (number == 469) return false;
if (number == 470) return true;
if (number == 471) return false;
if (number == 472) return true;
if (number == 473) return false;
if (number == 474) return true;
if (number == 475) return false;
if (number == 476) return true;
if (number == 477) return false;
if (number == 478) return true;
if (number == 479) return false;
if (number == 480) return true;
if (number == 481) return false;
if (number == 482) return true;
if (number == 483) return false;
if (number == 484) return true;
if (number == 485) return false;
if (number == 486) return true;
if (number == 487) return false;
if (number == 488) return true;
if (number == 489) return false;
if (number == 490) return true;
if (number == 491) return false;
if (number == 492) return true;
if (number == 493) return false;
if (number == 494) return true;
if (number == 495) return false;
if (number == 496) return true;
if (number == 497) return false;
if (number == 498) return true;
if (number == 499) return false;
if (number == 500) return true;
if (number == 501) return false;
if (number == 502) return true;
if (number == 503) return false;
if (number == 504) return true;
if (number == 505) return false;
if (number == 506) return true;
if (number == 507) return false;
if (number == 508) return true;
if (number == 509) return false;
if (number == 510) return true;
if (number == 511) return false;
if (number == 512) return true;
if (number == 513) return false;
if (number == 514) return true;
if (number == 515) return false;
if (number == 516) return true;
if (number == 517) return false;
if (number == 518) return true;
if (number == 519) return false;
if (number == 520) return true;
if (number == 521) return false;
if (number == 522) return true;
if (number == 523) return false;
if (number == 524) return true;
if (number == 525) return false;
if (number == 526) return true;
if (number == 527) return false;
if (number == 528) return true;
if (number == 529) return false;
if (number == 530) return true;
if (number == 531) return false;
if (number == 532) return true;
if (number == 533) return false;
if (number == 534) return true;
if (number == 535) return false;
if (number == 536) return true;
if (number == 537) return false;
if (number == 538) return true;
if (number == 539) return false;
if (number == 540) return true;
if (number == 541) return false;
if (number == 542) return true;
if (number == 543) return false;
if (number == 544) return true;
if (number == 545) return false;
if (number == 546) return true;
if (number == 547) return false;
if (number == 548) return true;
if (number == 549) return false;
if (number == 550) return true;
if (number == 551) return false;
if (number == 552) return true;
if (number == 553) return false;
if (number == 554) return true;
if (number == 555) return false;
if (number == 556) return true;
if (number == 557) return false;
if (number == 558) return true;
if (number == 559) return false;
if (number == 560) return true;
if (number == 561) return false;
if (number == 562) return true;
if (number == 563) return false;
if (number == 564) return true;
if (number == 565) return false;
if (number == 566) return true;
if (number == 567) return false;
if (number == 568) return true;
if (number == 569) return false;
if (number == 570) return true;
if (number == 571) return false;
if (number == 572) return true;
if (number == 573) return false;
if (number == 574) return true;
if (number == 575) return false;
if (number == 576) return true;
if (number == 577) return false;
if (number == 578) return true;
if (number == 579) return false;
if (number == 580) return true;
if (number == 581) return false;
if (number == 582) return true;
if (number == 583) return false;
if (number == 584) return true;
if (number == 585) return false;
if (number == 586) return true;
if (number == 587) return false;
if (number == 588) return true;
if (number == 589) return false;
if (number == 590) return true;
if (number == 591) return false;
if (number == 592) return true;
if (number == 593) return false;
if (number == 594) return true;
if (number == 595) return false;
if (number == 596) return true;
if (number == 597) return false;
if (number == 598) return true;
if (number == 599) return false;
if (number == 600) return true;
if (number == 601) return false;
if (number == 602) return true;
if (number == 603) return false;
if (number == 604) return true;
if (number == 605) return false;
if (number == 606) return true;
if (number == 607) return false;
if (number == 608) return true;
if (number == 609) return false;
if (number == 610) return true;
if (number == 611) return false;
if (number == 612) return true;
if (number == 613) return false;
if (number == 614) return true;
if (number == 615) return false;
if (number == 616) return true;
if (number == 617) return false;
if (number == 618) return true;
if (number == 619) return false;
if (number == 620) return true;
if (number == 621) return false;
if (number == 622) return true;
if (number == 623) return false;
if (number == 624) return true;
if (number == 625) return false;
if (number == 626) return true;
if (number == 627) return false;
if (number == 628) return true;
if (number == 629) return false;
if (number == 630) return true;
if (number == 631) return false;
if (number == 632) return true;
if (number == 633) return false;
if (number == 634) return true;
if (number == 635) return false;
if (number == 636) return true;
if (number == 637) return false;
if (number == 638) return true;
if (number == 639) return false;
if (number == 640) return true;
if (number == 641) return false;
if (number == 642) return true;
if (number == 643) return false;
if (number == 644) return true;
if (number == 645) return false;
if (number == 646) return true;
if (number == 647) return false;
if (number == 648) return true;
if (number == 649) return false;
if (number == 650) return true;
if (number == 651) return false;
if (number == 652) return true;
if (number == 653) return false;
if (number == 654) return true;
if (number == 655) return false;
if (number == 656) return true;
if (number == 657) return false;
if (number == 658) return true;
if (number == 659) return false;
if (number == 660) return true;
if (number == 661) return false;
if (number == 662) return true;
if (number == 663) return false;
if (number == 664) return true;
if (number == 665) return false;
if (number == 666) throw new ArgumentException("Heathen!");
if (number == 667) return false;
// ...
if (number == 65255) return false;
if (number == 65256) return true;
if (number == 65257) return false;
if (number == 65258) return true;
if (number == 65259) return false;
if (number == 65260) return true;
if (number == 65261) return false;
if (number == 65262) return true;
if (number == 65263) return false;
if (number == 65264) return true;
if (number == 65265) return false;
if (number == 65266) return true;
if (number == 65267) return false;
if (number == 65268) return true;
if (number == 65269) return false;
if (number == 65270) return true;
if (number == 65271) return false;
if (number == 65272) return true;
if (number == 65273) return false;
if (number == 65274) return true;
if (number == 65275) return false;
if (number == 65276) return true;
if (number == 65277) return false;
if (number == 65278) return true;
if (number == 65279) return false;
if (number == 65280) return true;
if (number == 65281) return false;
if (number == 65282) return true;
if (number == 65283) return false;
if (number == 65284) return true;
if (number == 65285) return false;
if (number == 65286) return true;
if (number == 65287) return false;
if (number == 65288) return true;
if (number == 65289) return false;
if (number == 65290) return true;
if (number == 65291) return false;
if (number == 65292) return true;
if (number == 65293) return false;
if (number == 65294) return true;
if (number == 65295) return false;
if (number == 65296) return true;
if (number == 65297) return false;
if (number == 65298) return true;
if (number == 65299) return false;
if (number == 65300) return true;
if (number == 65301) return false;
if (number == 65302) return true;
if (number == 65303) return false;
if (number == 65304) return true;
if (number == 65305) return false;
if (number == 65306) return true;
if (number == 65307) return false;
if (number == 65308) return true;
if (number == 65309) return false;
if (number == 65310) return true;
if (number == 65311) return false;
if (number == 65312) return true;
if (number == 65313) return false;
if (number == 65314) return true;
if (number == 65315) return false;
if (number == 65316) return true;
if (number == 65317) return false;
if (number == 65318) return true;
if (number == 65319) return false;
if (number == 65320) return true;
if (number == 65321) return false;
if (number == 65322) return true;
if (number == 65323) return false;
if (number == 65324) return true;
if (number == 65325) return false;
if (number == 65326) return true;
if (number == 65327) return false;
if (number == 65328) return true;
if (number == 65329) return false;
if (number == 65330) return true;
if (number == 65331) return false;
if (number == 65332) return true;
if (number == 65333) return false;
if (number == 65334) return true;
if (number == 65335) return false;
if (number == 65336) return true;
if (number == 65337) return false;
if (number == 65338) return true;
if (number == 65339) return false;
if (number == 65340) return true;
if (number == 65341) return false;
if (number == 65342) return true;
if (number == 65343) return false;
if (number == 65344) return true;
if (number == 65345) return false;
if (number == 65346) return true;
if (number == 65347) return false;
if (number == 65348) return true;
if (number == 65349) return false;
if (number == 65350) return true;
if (number == 65351) return false;
if (number == 65352) return true;
if (number == 65353) return false;
if (number == 65354) return true;
if (number == 65355) return false;
if (number == 65356) return true;
if (number == 65357) return false;
if (number == 65358) return true;
if (number == 65359) return false;
if (number == 65360) return true;
if (number == 65361) return false;
if (number == 65362) return true;
if (number == 65363) return false;
if (number == 65364) return true;
if (number == 65365) return false;
if (number == 65366) return true;
if (number == 65367) return false;
if (number == 65368) return true;
if (number == 65369) return false;
if (number == 65370) return true;
if (number == 65371) return false;
if (number == 65372) return true;
if (number == 65373) return false;
if (number == 65374) return true;
if (number == 65375) return false;
if (number == 65376) return true;
if (number == 65377) return false;
if (number == 65378) return true;
if (number == 65379) return false;
if (number == 65380) return true;
if (number == 65381) return false;
if (number == 65382) return true;
if (number == 65383) return false;
if (number == 65384) return true;
if (number == 65385) return false;
if (number == 65386) return true;
if (number == 65387) return false;
if (number == 65388) return true;
if (number == 65389) return false;
if (number == 65390) return true;
if (number == 65391) return false;
if (number == 65392) return true;
if (number == 65393) return false;
if (number == 65394) return true;
if (number == 65395) return false;
if (number == 65396) return true;
if (number == 65397) return false;
if (number == 65398) return true;
if (number == 65399) return false;
if (number == 65400) return true;
if (number == 65401) return false;
if (number == 65402) return true;
if (number == 65403) return false;
if (number == 65404) return true;
if (number == 65405) return false;
if (number == 65406) return true;
if (number == 65407) return false;
if (number == 65408) return true;
if (number == 65409) return false;
if (number == 65410) return true;
if (number == 65411) return false;
if (number == 65412) return true;
if (number == 65413) return false;
if (number == 65414) return true;
if (number == 65415) return false;
if (number == 65416) return true;
if (number == 65417) return false;
if (number == 65418) return true;
if (number == 65419) return false;
if (number == 65420) return true;
if (number == 65421) return false;
if (number == 65422) return true;
if (number == 65423) return false;
if (number == 65424) return true;
if (number == 65425) return false;
if (number == 65426) return true;
if (number == 65427) return false;
if (number == 65428) return true;
if (number == 65429) return false;
if (number == 65430) return true;
if (number == 65431) return false;
if (number == 65432) return true;
if (number == 65433) return false;
if (number == 65434) return true;
if (number == 65435) return false;
if (number == 65436) return true;
if (number == 65437) return false;
if (number == 65438) return true;
if (number == 65439) return false;
if (number == 65440) return true;
if (number == 65441) return false;
if (number == 65442) return true;
if (number == 65443) return false;
if (number == 65444) return true;
if (number == 65445) return false;
if (number == 65446) return true;
if (number == 65447) return false;
if (number == 65448) return true;
if (number == 65449) return false;
if (number == 65450) return true;
if (number == 65451) return false;
if (number == 65452) return true;
if (number == 65453) return false;
if (number == 65454) return true;
if (number == 65455) return false;
if (number == 65456) return true;
if (number == 65457) return false;
if (number == 65458) return true;
if (number == 65459) return false;
if (number == 65460) return true;
if (number == 65461) return false;
if (number == 65462) return true;
if (number == 65463) return false;
if (number == 65464) return true;
if (number == 65465) return false;
if (number == 65466) return true;
if (number == 65467) return false;
if (number == 65468) return true;
if (number == 65469) return false;
if (number == 65470) return true;
if (number == 65471) return false;
if (number == 65472) return true;
if (number == 65473) return false;
if (number == 65474) return true;
if (number == 65475) return false;
if (number == 65476) return true;
if (number == 65477) return false;
if (number == 65478) return true;
if (number == 65479) return false;
if (number == 65480) return true;
if (number == 65481) return false;
if (number == 65482) return true;
if (number == 65483) return false;
if (number == 65484) return true;
if (number == 65485) return false;
if (number == 65486) return true;
if (number == 65487) return false;
if (number == 65488) return true;
if (number == 65489) return false;
if (number == 65490) return true;
if (number == 65491) return false;
if (number == 65492) return true;
if (number == 65493) return false;
if (number == 65494) return true;
if (number == 65495) return false;
if (number == 65496) return true;
if (number == 65497) return false;
if (number == 65498) return true;
if (number == 65499) return false;
if (number == 65500) return true;
if (number == 65501) return false;
if (number == 65502) return true;
if (number == 65503) return false;
if (number == 65504) return true;
if (number == 65505) return false;
if (number == 65506) return true;
if (number == 65507) return false;
if (number == 65508) return true;
if (number == 65509) return false;
if (number == 65510) return true;
if (number == 65511) return false;
if (number == 65512) return true;
if (number == 65513) return false;
if (number == 65514) return true;
if (number == 65515) return false;
if (number == 65516) return true;
if (number == 65517) return false;
if (number == 65518) return true;
if (number == 65519) return false;
if (number == 65520) return true;
if (number == 65521) return false;
if (number == 65522) return true;
if (number == 65523) return false;
if (number == 65524) return true;
if (number == 65525) return false;
if (number == 65526) return true;
if (number == 65527) return false;
if (number == 65528) return true;
if (number == 65529) return false;
if (number == 65530) return true;
if (number == 65531) return false;
if (number == 65532) return true;
if (number == 65533) return false;
if (number == 65534) return true;
if (number == 65535) return false;
throw new ArgumentOutOfRangeException("number", "Number is out of range of `IsEven`.");
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment