/*** We provide a couple of additional elementary operations. The ulp* operation is defined for integer, float and decimal. It returns a* result of the same type as its argument.** ulp: integer -> integer isqrt: integer -> integer* ulp: float -> float sqrtrem: integer -> integer^2* ulp: decimal -> decimal iroot: integer^2 -> integer* rootrem: integer^2 -> integer^2** The ulp operation makes use of the ulp() function of the Java Math* library. The root operations work on integers and use a combination* of Newton and Zimmermann algorithms.** Examples:* ulp(0) --> 1 isqrt(7) --> 2* ulp(0.0) --> 4.9E-324 sqrtrem(7) --> (2,3)* ulp(0d0.00) --> 0d0.01 iroot(77,5) --> 2* rootrem(77,5) --> (2, 45)** The predicate divmod/4 returns both the quotient and remainder of a* division. This is faster than invoking the ISO core standard evaluable* functions (//)/2 and (rem)/2 separately.** Warranty & Liability* To the extent permitted by applicable law and unless explicitly* otherwise agreed upon, XLOG Technologies GmbH makes no warranties* regarding the provided information. XLOG Technologies GmbH assumes* no liability that any problems might be solved with the information* provided by XLOG Technologies GmbH.** Rights & License* All industrial property rights regarding the information - copyright* and patent rights in particular - are the sole property of XLOG* Technologies GmbH. If the company was not the originator of some* excerpts, XLOG Technologies GmbH has at least obtained the right to* reproduce, change and translate the information.** Reproduction is restricted to the whole unaltered document. Reproduction* of the information is only allowed for non-commercial uses. Selling,* giving away or letting of the execution of the library is prohibited.* The library can be distributed as part of your applications and libraries* for execution provided this comment remains unchanged.** Restrictions* Only to be distributed with programs that add significant and primary* functionality to the library. Not to be distributed with additional* software intended to replace any components of the library.** Trademarks* Jekejeke is a registered trademark of XLOG Technologies GmbH.*/* ulp(X, Y):* The predicate succeeds in Y with the unit of least precision of* the number X.*/* modinv(B, M, R):* The predicate succeeds in R with B^(-1) mod M.*/* modpow(B, E, M, R):* The predicate succeeds in R with B^E mod M.*/% Sqrt Root/*** isqrt(X, Y):* The predicate succeeds in Y with the integer square root of X.*/% isqrt(+Integer, -Integer)* sqrtrem(X, Y, Z):* The predicate succeeds in Y with integer square root of X* and in Z with the corresponding remainder.*/% sqrtrem(+Integer, -Integer, -Integer)% N-th Root/*** iroot(X, Y, Z):* The predicate succeeds in Z with the Y-th root of X.*/% iroot(+Integer, +Integer, -Integer)Z = X.* rootrem(X, Y, Z, T):* The predicate succeeds in Z with the Y-th root of X* and in T with the corresponding remainder.*/% Helper% shiftup(+Integer, +Integer, -Integer)V = P.