# Fahrenheit...

• 09-13-2003
Lurker
Fahrenheit...
...to celsius. What is the formula for conversion from F to C and C to F? Thanks all :D !
• 09-13-2003
TravisS
• 09-13-2003
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?
• 09-14-2003
joshdick
Quote:

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?

It's a wonder what a little googling can accomplish.
• 09-14-2003
Lurker
OK, I must be missing somethign real simple here, but what the hell is wrong here:
Code:

```#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 .
• 09-14-2003
Lurker
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!

Code:

```#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!

Code:

```#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; }```
• 09-14-2003
Govtcheez
Quote:

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

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.
• 09-14-2003
joshdick
Quote:

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

Code:

`        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.
• 09-14-2003
Lurker
Duhduhduh....thanks man, thats what I needed :D .
• 09-15-2003
Fountain
Quote:

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). :)
• 09-15-2003
XSquared
>>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.