Comparing type precision

I believe you are looking for type promotion. Take a look here: Conversion and Promotion · The Julia Language

For example:

julia> x = promote(2, 3.1, 5//7, big(2.3))
(2.0, 3.100000000000000088817841970012523233890533447265625, 0.714285714285714285714285714285714285714285714285714285714285714285714285714282, 2.29999999999999982236431605997495353221893310546875)

There is also promote_type for working with types instead of values.

6 Likes