PDA

View Full Version : Fahrenheit...

Lurker
09-13-2003, 09:21 PM
...to celsius. What is the formula for conversion from F to C and C to F? Thanks all :D !

TravisS
09-13-2003, 09:45 PM
First off, google (www.google.com)

Anyway....

http://www.condoconcepts.com/convers.htm

http://vathena.arc.nasa.gov/curric/weather/fahrcels.html

http://www.nomoreodor.com/fahrenheit_to_celsius_conversion.htm

etc...

Thantos
09-13-2003, 10:44 PM
This is what I've always wondered and haven't been able to find a good answer.

The Celsius scale is based off of the freezing and boiling point of water. What the hell is Fahrenheit based off of?

joshdick
09-13-2003, 11:44 PM
Originally posted by Thantos
This is what I've always wondered and haven't been able to find a good answer.

The Celsius scale is based off of the freezing and boiling point of water. What the hell is Fahrenheit based off of?

http://www.gi.alaska.edu/ScienceForum/ASF13/1317.html

It's a wonder what a little googling can accomplish.

Lurker
09-13-2003, 11:51 PM
OK, I must be missing somethign real simple here, but what the hell is wrong here:

#include <iostream>
using namespace std;

int main() {
int h = 105, l = 95;
cout << h << " " << l << endl;
h = (5 / 9) * (h - 32);
l = (5 / 9) * (l - 32);
cout << h << " " << l;
h = (9 / 5) * (h + 32);
l = (9 / 5) * (l + 32);
cout << h << " " << l;
return 0;
}
Thanks all :D .

Lurker
09-13-2003, 11:56 PM
Ah ha! They should be float's huh! I think I solved it...

EDIT: So heres what I got, but it isnt accurate enough. How could I make it more accurate? Thanks all!

#include <iostream>
using namespace std;

int main() {
int h = 105, l = 95;
cout << h << " " << l << endl;
h = (5.0f / 9.0f) * (h - 32);
l = (5.0f / 9.0f) * (l - 32);
cout << h << " " << l << endl;
h = (9.0f / 5.0f) * h + 32;
l = (9.0f / 5.0f) * l + 32;
cout << h << " " << l;
return 0;
}

EDIT 2:
Alright, what you want a float, you put an f after teh integer, what do you put for doubles? This is more accurate, but i dont want a variable for 5 and 9, and this still isnt accurate enough! Thanks all!

#include <iostream>
using namespace std;

int main() {
int h = 105, l = 95;
double d = 5, d2 = 9;
cout << h << " " << l << endl;
h = (d / d2) * (h - 32);
l = (d / d2) * (l - 32);
cout << h << " " << l << endl;
h = (d2 / d) * h + 32;
l = (d2 / d) * l + 32;
cout << h << " " << l;
return 0;
}

Govtcheez
09-14-2003, 06:55 AM
Originally posted by Thantos
What the hell is Fahrenheit based off of? It's got something to do with cooking Spaghetti-o's, IIRC.

Zach L.
09-14-2003, 08:35 AM
Originally posted by Thantos
What the hell is Fahrenheit based off of?
It was designed so that the average human body temperature would be 100.0... someone just screwed up a bit in the lab.

joshdick
09-14-2003, 10:47 AM
Originally posted by Lurker
EDIT: So heres what I got, but it isnt accurate enough. How could I make it more accurate? Thanks all!

int h = 105, l = 95;

There's your problem. You're still saving those temperature calculations into integers, thus losing a good deal of accuracy. Just make 'em doubles.

Lurker
09-14-2003, 01:42 PM
Duhduhduh....thanks man, thats what I needed :D .

Fountain
09-15-2003, 02:24 PM
Originally posted by Thantos
This is what I've always wondered and haven't been able to find a good answer.

The Celsius scale is based off of the freezing and boiling point of water. What the hell is Fahrenheit based off of?

Its based off of the fact that it is the "proper" temperature scale. Well, if you are old(ish). :)

XSquared
09-15-2003, 02:51 PM
>>Alright, what you want a float, you put an f after teh integer, what do you put for doubles?

You put nothing after a number for it to be a double.