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

Function reaumur_to_celsius

conversions/temperature_conversions.py:344–360  ·  view source on GitHub ↗

Convert a given value from reaumur to celsius and round it to 2 decimal places. Reference:- http://www.csgnetwork.com/temp2conv.html >>> reaumur_to_celsius(0) 0.0 >>> reaumur_to_celsius(20.0) 25.0 >>> reaumur_to_celsius(40) 50.0 >>> reaumur_to_celsius("reaumur")

(reaumur: float, ndigits: int = 2)

Source from the content-addressed store, hash-verified

342
343
344def reaumur_to_celsius(reaumur: float, ndigits: int = 2) -> float:
345 """
346 Convert a given value from reaumur to celsius and round it to 2 decimal places.
347 Reference:- http://www.csgnetwork.com/temp2conv.html
348
349 >>> reaumur_to_celsius(0)
350 0.0
351 >>> reaumur_to_celsius(20.0)
352 25.0
353 >>> reaumur_to_celsius(40)
354 50.0
355 >>> reaumur_to_celsius("reaumur")
356 Traceback (most recent call last):
357 ...
358 ValueError: could not convert string to float: 'reaumur'
359 """
360 return round((float(reaumur) * 1.25), ndigits)
361
362
363def reaumur_to_rankine(reaumur: float, ndigits: int = 2) -> float:

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected