Java Celsius to Fahrenheit toFahrenheit(double c)

Here you can find the source of toFahrenheit(double c)

Description

Swedish Astronomer Andres Celsius (1701-1744) Tf = (9/5)*Tc+32; Tc = temperature in degrees Celsius, Tf = temperature in degrees Fahrenheit

License

Open Source License

Parameter

Parameter Description
c degrees Celsius

Return

degrees Fahrenheit

Declaration

public static double toFahrenheit(double c) 

Method Source Code

//package com.java2s;
/*/*w  w w  .ja v  a  2  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 {
    /**
     * Swedish Astronomer Andres Celsius (1701-1744) 
     * Tf = (9/5)*Tc+32; Tc = temperature in degrees Celsius, Tf = temperature in degrees Fahrenheit
     * @param c degrees Celsius
     * @return degrees Fahrenheit
     */
    public static double toFahrenheit(double c) {
        double f = ((9.0f * c) / 5.0f) + 32.0f;
        //System.out.printf(" f: %g c: %g\n", f, c);
        return f;
    }
}

Related

  1. celsiusToFahrenheit(Double celsius)
  2. celsiusToFahrenheit(Double celsius)
  3. celsiusToFahrenheit(double temperature)
  4. celsiusToFahrenheit(float celsius)
  5. celsiusToFahrenheit(float value)