MCPcopy Create free account
hub / github.com/TheAlgorithms/Python / reaumur_to_kelvin

Function reaumur_to_kelvin

conversions/temperature_conversions.py:306–322  ·  view source on GitHub ↗

Convert a given value from reaumur to Kelvin and round it to 2 decimal places. Reference:- http://www.csgnetwork.com/temp2conv.html >>> reaumur_to_kelvin(0) 273.15 >>> reaumur_to_kelvin(20.0) 298.15 >>> reaumur_to_kelvin(40) 323.15 >>> reaumur_to_kelvin("reaumur

(reaumur: float, ndigits: int = 2)

Source from the content-addressed store, hash-verified

304
305
306def reaumur_to_kelvin(reaumur: float, ndigits: int = 2) -> float:
307 """
308 Convert a given value from reaumur to Kelvin and round it to 2 decimal places.
309 Reference:- http://www.csgnetwork.com/temp2conv.html
310
311 >>> reaumur_to_kelvin(0)
312 273.15
313 >>> reaumur_to_kelvin(20.0)
314 298.15
315 >>> reaumur_to_kelvin(40)
316 323.15
317 >>> reaumur_to_kelvin("reaumur")
318 Traceback (most recent call last):
319 ...
320 ValueError: could not convert string to float: 'reaumur'
321 """
322 return round((float(reaumur) * 1.25 + 273.15), ndigits)
323
324
325def reaumur_to_fahrenheit(reaumur: float, ndigits: int = 2) -> float:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected