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

Function reaumur_to_rankine

conversions/temperature_conversions.py:363–379  ·  view source on GitHub ↗

Convert a given value from reaumur to rankine and round it to 2 decimal places. Reference:- http://www.csgnetwork.com/temp2conv.html >>> reaumur_to_rankine(0) 491.67 >>> reaumur_to_rankine(20.0) 536.67 >>> reaumur_to_rankine(40) 581.67 >>> reaumur_to_rankine("re

(reaumur: float, ndigits: int = 2)

Source from the content-addressed store, hash-verified

361
362
363def reaumur_to_rankine(reaumur: float, ndigits: int = 2) -> float:
364 """
365 Convert a given value from reaumur to rankine and round it to 2 decimal places.
366 Reference:- http://www.csgnetwork.com/temp2conv.html
367
368 >>> reaumur_to_rankine(0)
369 491.67
370 >>> reaumur_to_rankine(20.0)
371 536.67
372 >>> reaumur_to_rankine(40)
373 581.67
374 >>> reaumur_to_rankine("reaumur")
375 Traceback (most recent call last):
376 ...
377 ValueError: could not convert string to float: 'reaumur'
378 """
379 return round((float(reaumur) * 2.25 + 32 + 459.67), ndigits)
380
381
382if __name__ == "__main__":

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected