converted Float to int, still cannot compare two numbers from DHT22

// request to all devices on the bus
Serial.print("Requesting temperatures... ");

float DHT22_t = dht1.readTemperature();
float DHT22_h = dht1.readHumidity();

float DHT21_t = dht2.readTemperature();
float DHT21_h = dht2.readHumidity();

//dew point mathinside DHT22
double a = 17.271;
double b = 237.7;
double h2 = (DHT22_h);

double temp1 = (a * DHT22_t);
double temp2 = ( b + DHT22_t );
double temp3 = (temp1 / temp2);
double temp5 = (h2 / 100);

double temp4 = log((double) temp5);
double temp6 = (temp4 + temp3);
double temp7 = (temp4 - temp3);
double semi1 = (b * temp6);
double semi2 = (a - temp7);
double ITd = (semi1 / semi2);
double Itf = ( DHT22_t * 1.8) + 32;
double Idf = ( ITd * 1.8) + 32;

//dew point math outside DHT21
double a1 = 17.271;
double b1 = 237.7;
double h21 = (DHT21_h);

double temp11 = (a1 * DHT21_t);
double temp21 = ( b1 + DHT21_t);
double temp31 = (temp1 / temp2);
double temp51 = (h21 / 100);

double temp41 = log((double) temp51);
double temp61 = (temp41 + temp31);
double temp71 = (temp41 - temp31);
double semi11 = (b1 * temp61);
double semi21 = (a1 - temp71);
double OTd = (semi11 / semi21);
double Otf = ( DHT21_t * 1.8) + 32;
double Odf = ( OTd * 1.8) + 32;

// converting all DHT info from float #'s to int's...

int i = DHT22_h;
int T = Itf;
int I = DHT21_h;
int t = Otf;
int D = Idf;
int d = Odf;

//good air outside, run fan as long as no interfeirence with inside dewpoint
if (t < templow && t > temphigh)
{
( tempbit = 1);
}

//bad air outside do not run fan
if (t > templow && t < temphigh)
{
(tempbit = 0);
}

// check if returns are valid, if they are NaN (not a number) then something went wrong!
if (isnan(DHT22_t) || isnan(DHT22_h))
{
Serial.println("Failed to read from DHT #1");
digitalWrite (ouTnan, HIGH);
}
else
{
Serial.println ();
Serial.println ();
Serial.print ("Humidity outside: ");
Serial.print(DHT21_h);
Serial.print(" %\t");
Serial.println ();
Serial.print ("rounded humidity outside:");
Serial.print ( I);

Serial.println ();
Serial.print ("Temperature outside: ");
Serial.print(Otf);
Serial.println("*F");
Serial.println ();
Serial.print ("rounded temp outside");
Serial.print (t);

Serial.println ();
Serial.print ( " Outside dewpointF:");
Serial.print ( Odf);
Serial.print ("*F ");
Serial.println ();
Serial.print ( "rounded Dew point outside");
Serial.print ( d);

digitalWrite (ouTnan, LOW);
}

if (isnan(DHT21_t) || isnan(DHT21_t)) {
Serial.println("Failed to read from DHT #2");
digitalWrite (iNnan, HIGH);
}
else
{
Serial.println ();
Serial.print ("Humidity inside:");
Serial.print(DHT22_h);
Serial.print(" %\t ");
Serial.println ();
Serial.print ( "rounded indoor humidity");
Serial.print ( i);

Serial.println ();
Serial.print ("Temperature inside:");
Serial.print(Itf);
Serial.println("*F");
Serial.println ();
Serial.print ("rounded temp inside:");
Serial.print (T);

Serial.println ();
Serial.print ( "Inside Dewpoint:");
Serial.print ( Idf);
Serial.print ("*F");
Serial.println ();
Serial.print ("Rounded Dew point Inside ");
Serial.print (D);

Serial.println ();
Serial.print (" temp Bit Status");
Serial.print (tempbit);
Serial.println ();
Serial.print ("temp Bit High: ");
Serial.print (temphigh);
Serial.println ();
Serial.print ("TEMP BIT LOW: ");
Serial.print (templow);

Serial.println ();

// indoor humidity is less than 40, indoor humidity is less than 70, exterior dew pointmust be larger than interior temp, outdoor temp must be above 40°
if (( i < 40 ) && (i < 70) && ( d < T ) && (tempbit == 0) && (t < 40))
{
digitalWrite ( fan, LOW);
digitalWrite (fanled, LOW);
digitalWrite (off, HIGH);
digitalWrite (toohumidout, LOW);
digitalWrite (toohumidin , LOW);
digitalWrite (toocold , HIGH);
Serial.print ("zero");

}

why is it when my T is 71 and my d is 21, does my arduino think that 21 is greater than 71? it makes no sense. i converted my floats to ints, so it should compare no problem , right?

Post your code as instructed in Item #6 here:
Programming Questions > Read this before posting a programming question …

Identify which line in the code is giving the problem.

Please edit your post (do More -> modify, so you get the toolbar)

Use code tags (the </> button - you can highlight the code and click it to put the code in code tags - this makes it easier to read and prevents certain character combinations from getting converted to smilies)

Include the whole sketch, not a piece of the sketch - usually when people include only part of a sketch, there is a key piece of information in the part they didn't post. Finding where the problem is is usually harder than knowing how to fix it once you've done that, so when you're having trouble fixing it, you should not trust that you know what part of the code the bug is hiding in.

// indoor humidity is less than 40, indoor humidity is less than 70, exterior dew pointmust be larger than interior temp, outdoor temp must be above 40°
  if (( i < 40 ) && (i < 70) && ( d < T ) && (tempbit == 0) && (t < 40))

Seriously? I mean, at least your comments match the nonsense corresponding to them. I think if the indoor humidity is under 40, it's safe to assume that it's also under 70, no?

Is that the line where the problem becomes evident? If so, post the values of the variables involved - the console output immediately before and after it would be useful for us.

You can compare floats with > and < just fine; what you can't do is use == to compare them, since two things that any of us would call equal may not be quite equal.

how can i include the whole sketch when this site only allows 9000 characters.... this is 1/4th of my sketch, this program is huge. :-/

well i have obviously tried comparing floats with < and>, and it does not work. after a lot of research i have found out that many people convert to int to help with math.

i need to compare the temperature inside to the dew point outside. the thing that bugs me though is all of my other comparisons work. everything besides (d>T) or (d>T)

i am going to try and change that back to floats and see if that one portion will compare as a float # instead.

should i do multiple posts to include entire code?

so now i tried subtracting d from T, and it works spot on.... i think you guys are right, my problems are somewhere else in the code. maybe i should post the entire code, but i am going to tell you, its very long...

When you reply, there is an option to attach your code - then the length of the sketch doesn't matter.

maybe i should post the entire code, but i am going to tell you, its very long...

While you can use Reply, not the Quick Reply field, and attach your program, I suspect that the real problem is that you have not systematically developed the program, using functions to build up the program, and/or have not tested each function thoroughly.

Throwing a mess of code at us isn't going to do you any favors. The first thing that we will do is suggest that you start over, with small functions, thoroughly tested.

@OP can you see how similar this code

    Serial.println ();
    Serial.println ();
    Serial.print ("Humidity outside: ");
    Serial.print(DHT21_h);
    Serial.print(" %\t");
    Serial.println ();
    Serial.print ("rounded humidity outside:");
    Serial.print ( I);


    Serial.println ();
    Serial.print ("Temperature outside: ");
    Serial.print(Otf);
    Serial.println("*F");
    Serial.println ();
    Serial.print ("rounded temp outside");
    Serial.print (t);



    Serial.println ();
    Serial.print ( " Outside dewpointF:");
    Serial.print ( Odf);
    Serial.print ("*F ");
    Serial.println ();
    Serial.print ( "rounded Dew point outside");
    Serial.print ( d);
  }

looks to this code

    Serial.println ();
    Serial.print ("Humidity inside:");
    Serial.print(DHT22_h);
    Serial.print(" %\t ");
    Serial.println ();
    Serial.print ( "rounded indoor humidity");
    Serial.print ( i);

    Serial.println ();
    Serial.print ("Temperature inside:");
    Serial.print(Itf);
    Serial.println("*F");
    Serial.println ();
    Serial.print ("rounded temp inside:");
    Serial.print (T);


    Serial.println ();
    Serial.print ( "Inside Dewpoint:");
    Serial.print ( Idf);
    Serial.print ("*F");
    Serial.println ();
    Serial.print ("Rounded Dew point Inside  ");
    Serial.print (D);

?

That's part of the reason your code is too long to post.
When you were at school doing algebra, you were taught to factor expressions that contained similarities, to shorten and simplify. You need to apply similar principles here, as PaulS wrote, using functions.
If you just blindly copy and paste code, you run the risk of copying and pasting the bugs too - it is much better to reduce code to the bare minimum that does the job, and call that code repeatedly, with different parameters.