Here you can find the source of toCelsius(double f)
Parameter | Description |
---|---|
f | degrees Fahrenheit |
public static double toCelsius(double f)
//package com.java2s; /*/*from w w w.ja v a2 s . c o m*/ * TemperatureUtils.java * * Created on March 30, 2006, 10:40 PM * * Copyright (c) 2006, Pat Farrell. All rights reserved. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ public class Main { /** * German born scientist Gabriel Daniel Fahrenheit. He is credited with the invention of the mercury thermometer and introduced it and his scale in 1714 in Holland.<br> * Tc = (5/9)*(Tf-32); Tc = temperature in degrees Celsius, Tf = temperature in degrees Fahrenheit * @param f degrees Fahrenheit * @return degrees Celsius */ public static double toCelsius(double f) { double c = (5.0f / 9.0f) * (f - 32.0f); //System.out.printf(" f: %g c: %g\n", f, c); return c; } }