C Library Functions - c2f (3)
NAME
c2f(3f) - [M_units:TEMPERATURE] convert Celsius to Fahrenheit
(LICENSE:PD)
CONTENTS
Synopsis
Description
Options
Example
Author
License
SYNOPSIS
elemental real function c2f(celsius)
class(*),intent(in) :: celsius
DESCRIPTION
Converts Celsius temperatures to Fahrenheit using the formula:
fahrenheit=(celsius+40.0)*9.0/5.0 - 40.0
OPTIONS
|
celsius |
| |
any standard scalar value supported by anyscalar_to_real(3f).
|
|
EXAMPLE
Sample program
program demo_c2f
use M_units, only : c2f
implicit none
write(*,*)With REAL array input , c2f([ -40.0, 0.0, 100.0 ])
write(*,*)With INTEGER array input , c2f([ -40, 0, 100 ])
write(*,*)With DOUBLEPRECISION , c2f(-40.0d0),c2f(0.0d0),c2f(100.0d0)
end program demo_c2f
Results
With REAL array input -40.0000000 32.0000000 212.000000
With INTEGER array input -40.0000000 32.0000000 212.000000
With DOUBLEPRECISION -40.0000000 32.0000000 212.000000
AUTHOR
John S. Urban
LICENSE
Public Domain
| Nemo Release 3.1 | c2f (3) | June 29, 2025 |
Generated by manServer 1.08 from 1e837fc4-627f-4661-b3eb-02b1045bdb81 using man macros.