Jump to content

Test integerness: Difference between revisions

Line 442:
<lang c sharp>
 
using System;
 
namespace Test_integerness
Line 497 ⟶ 496:
else if(LINE.ToUpper().Contains("I"))
{
// Delete letter i
LINE = LINE.ToUpper().Replace("I","");
if(string LINEr = string.Contains("+")Empty; // real )part
Nstring i = LINEstring.Split('+')Empty; // imaginary part
else
N = LINE.Split('-');
int s = 1; // sign offset
NUMBER// =Get double.Parse(N[1]);sign
if(LINE[0]=='+' || LINE[0]=='-')
{
r+=LINE[0].ToString();
NLINE = LINE.SplitRemove('-'0,1);
s--;
}
// Get real part
foreach (char element in LINE)
{
if(element!='+' && element!='-')
r+=element.ToString();
else
break;
}
// get imaginary part
i = LINE.Substring(LINE.Length-(r.Length+s));
NUMBER = double.Parse(i);
if(NUMBER==0)
NUMBER = double.Parse(N[0]r);
else
NUMBER = double.NaN;
Cookies help us deliver our services. By using our services, you agree to our use of cookies.