Performing arithmetic operations in quadruple precision

Also see this: Change default precision - #47 by stevengj

using DecFP
using ChangePrecision

y = Dec128(5)/Dec128(36)-Dec128(7)*√Dec128(15)/Dec128(30)

@changeprecision Dec128 begin
    z = 5/36 - 7*√15/30
end

y == z  # true

EDIT: or more concisely:

@changeprecision Dec128 z = 5/36-7*√15/30
2 Likes