ArbFloats.ArbFloats
— Moduleprecision(ArbFloat) # show the current default precision setprecision(ArbFloat, 120) # change the current default precision setprecision(ArbFloat, 53+7) # akin to setprecision(BigFloat, 53)
ArbFloat(12) # use the default precision, at run time ArbFloat{200}(12) # use specified precision, at run time ArbFloat(200,"12") # use the specified precision, at run time @ArbFloat(12) # use the default precision, at compile time @ArbFloat(200,12) # use specified precision, at compile time
@ArbFloat(1.2345) == ArbFloat("1.2345")
remember to do this and to avoid this
goodValue = @ArbFloat(1.2345) wrongValue = ArbFloat(1.2345);
1.234500000000000000 1.2344999999999999307
ArbFloat(12345)/ArbFloat(1000) ArbFloat(12.345)/ArbFloat(10)
1.234500000000000000 1.234500000000000064
setprecision(ArbFloat, 80)
exp1 = exp(ArbFloat(1));
stringsmall(exp1),stringcompact(exp1),string(exp1),stringall(exp1)
> ("2.7182818","2.71828182845905","2.71828182845904523536029","2.71828182845904523536029")
showall_pm(exp1)
> 2.718281828459045235360286±3.3216471534462276e-24
bounds(exp1)
> ( 2.71828182845904523536028, 2.718281828459045235360293 )
setprecision(ArbFloat, 116); # the initial default precision
fuzzed_e = tan(atanh(tanh(atan(exp(one(ArbFloat))))))
> 2.718281828459045235360287
showall(fuzzed_e)
> 2.7182818284590452353602874713527
bounds(fuzzed_e)
> ( 2.718281828459045235360287,
2.718281828459045235360287 )
> they are not really the same ...
lo, hi = bounds(fuzzed_e); showall(lo,hi)
> ( 2.7182818284590452353602874713526543,
2.7182818284590452353602874713526701 )
smartstring(fuzzed_e)
> "2.7182818284590452353602874713527-"
ArbFloats.approxeq
— Methodtrue if it is quite likely that the arguments indicate the same value
ArbFloats.areequal
— Methodtrue iff midpoint(x)==midpoint(y) and radius(x)==radius(y)
ArbFloats.contains
— Methodtrue iff x spans (covers) all of y
ArbFloats.doesnotcontain
— Methodtrue iff x does not span (cover) all of y
ArbFloats.donotoverlap
— Methodtrue iff x and y have no common point
ArbFloats.excludes_integer
— Methodtrue iff x does not contain an integer
ArbFloats.excludes_zero
— Methodtrue iff x does not contain zero
ArbFloats.force_nonnegative_content
— Methodforcenonnegativecontent(x::ArbFloat) returns x without any content < 0 if x is strictly < 0, returns 0
ArbFloats.force_positive_content
— Methodforcepositivecontent(x::ArbFloat) returns x without any content <= 0 if x is strictly <= 0, returns eps(lowerbound(x))
ArbFloats.includes_integer
— Methodtrue iff x contains an integer
ArbFloats.includes_negative
— Methodtrue iff x contains a negative value
ArbFloats.includes_nonnegative
— Methodtrue iff x contains a nonnegative value
ArbFloats.includes_nonpositive
— Methodtrue iff x contains a nonpositive value
ArbFloats.includes_positive
— Methodtrue iff x contains a positive value
ArbFloats.includes_zero
— Methodtrue iff x contains zero
ArbFloats.iscontainedby
— Methodtrue iff y spans (covers) all of x
ArbFloats.isexact
— Methodtrue iff radius is zero
ArbFloats.isnegative
— Methodtrue iff upperbound(x) is negative
ArbFloats.isnotcontainedby
— Methodtrue iff y does not span (cover) all of x
ArbFloats.isolate_nonnegative_content
— Methodisolatenonnegativecontent(x::ArbFloat) returns x without any content < 0 if x is strictly < 0, returns ArbFloat's NaN
ArbFloats.isolate_positive_content
— Methodisolatepositivecontent(x::ArbFloat) returns x without any content <= 0 if x is strictly <= 0, returns ArbFloats' NaN
ArbFloats.isone
— Methodtrue iff midpoint(x) is one and radius(x) is zero
ArbFloats.ispositive
— Methodtrue iff lowerbound(x) is positive
ArbFloats.midpoint_precision
— MethodReturns the number of bits needed to represent the absolute value of the mantissa of the midpoint of x, i.e. the minimum precision sufficient to represent x exactly. Returns 0 if the midpoint of x is a special value.
ArbFloats.nonzero
— Methodtrue iff zero is not within [upperbound(x), lowerbound(x)]
ArbFloats.notequal
— Methodtrue iff midpoint(x)!=midpoint(y) or radius(x)!=radius(y)
ArbFloats.notexact
— Methodtrue iff radius is nonzero
ArbFloats.notfinite
— Methodisnan or isinf
ArbFloats.notinteger
— Methodtrue iff midpoint(x) is not an integer or radius(x) is nonzero
ArbFloats.notnegative
— Methodtrue iff lowerbound(x) is zero or positive
ArbFloats.notone
— Methodtrue iff midpoint(x) is not one or midpoint(x) is one and radius(x) is nonzero
ArbFloats.notpositive
— Methodtrue iff upperbound(x) is zero or negative
ArbFloats.notzero
— Methodtrue iff midpoint(x) or radius(x) are not zero
ArbFloats.overlap
— Methodtrue iff x and y have a common point
ArbFloats.relative_accuracy
— MethodReturns the effective relative accuracy of x measured in bits, equal to the negative of the return value from relativeError().
ArbFloats.relative_error
— MethodReturns the effective relative error of x measured in bits, defined as the difference between the position of the top bit in the radius and the top bit in the midpoint, plus one. The result is clamped between plus/minus ARFPRECEXACT.
ArbFloats.trimmed
— MethodSets y to a trimmed copy of x: rounds x to a number of bits equal to the accuracy of x (as indicated by its radius), plus a few guard bits. The resulting ball is guaranteed to contain x, but is more economical if x has less than full accuracy.
Base.iszero
— Methodmidpoint(x) and radius(x) are zero
ArbFloats.log_base
— Methodlogarithm_base(x)
ArbFloats.pfp
— Methodpositionfirstplace determine the position of the most significant nonzero bit|digit
ArbFloats.pfp10
— Methoddecimal positionfirstplace determine the position of the most significant nonzero digit
ArbFloats.pfp2
— Methodbinary positionfirstplace determine the position of the most significant nonzero bit
ArbFloats.tidy
— MethodRounds x to a clean estimate of x as a point value.
ArbFloats.trim
— MethodRounds x to a number of bits equal to the accuracy of x (as indicated by its radius), plus a few guard bits. The resulting ball is guaranteed to contain x, but is more economical if x has less than full accuracy. (from arb_trim documentation)
ArbFloats.ufp
— Functionufp is unitfirstplace the float value given by a 1 at the position of the most significant nonzero bit|digit in x
ArbFloats.ufp10
— Methodufp10 is unitfirstplace in base 10
ArbFloats.ufp2
— Methodufp2 is unitfirstplace in base 2
ArbFloats.ulp
— Methodulp is unitlastplace the float value given by a 1 at the position of the least significant nonzero bit|digit in x
ArbFloats.ulp10
— Methodulp10 is unitlastplace base 10
ArbFloats.ulp2
— Methodulp2 is unitlastplace base 2
Base.Math.frexp
— Methodx.midpoint -> (significand, exponentOf2) [0.5,1.0) 2^expo x.radius -> (radial significand, radial exponentOf2)
Base.isfinite
— MethodReturns nonzero iff the midpoint and radius of x are both finite floating-point numbers, i.e. not infinities or NaN.
Base.isinteger
— Methodtrue iff midpoint(x) is an integer and radius(x) is zero