Platforms to show: All Mac Windows Linux Cross-Platform
ACosHMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the inverse hyperbolic cosine of the real argument x.
Example:Notes:
acosh(1) returns +0.
acosh(x) returns a NAN for x < 1.
acosh(+infinity) returns +infinity.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the inverse hyperbolic cosine of the real argument x.
Example:
MsgBox str(ACosHMBS(5))
acosh(1) returns +0.
acosh(x) returns a NAN for x < 1.
acosh(+infinity) returns +infinity.
ACosMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the principal value of the arc cosine of x in the range [0, pi].
Example:Notes:
acos(1) returns +0.
acos(x) returns a NAN for |x| > 1.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the principal value of the arc cosine of x in the range [0, pi].
Example:
MsgBox str(ACosMBS(5))
acos(1) returns +0.
acos(x) returns a NAN for |x| > 1.
ArithmeticShiftMBS(value as Integer, count as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Does an arithmetic Shift of value and cares for the sign (+ or -).
Example:
Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Does an arithmetic Shift of value and cares for the sign (+ or -).
Example:
msgbox str(ArithmeticShiftMBS(5,3))
// displays 40 which is 5*(2^3) = 5 * 8
Some examples using this method:
ASinHMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the principal value of the arc sine of x in the range [-pi/2, +pi/2].
Example:Notes:
asin(+-0) returns +-0.
asin(x) returns a NAN for |x| > 1.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the principal value of the arc sine of x in the range [-pi/2, +pi/2].
Example:
MsgBox str(ASinHMBS(5))
asin(+-0) returns +-0.
asin(x) returns a NAN for |x| > 1.
ASinMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the principal value of the arc sine of x in the range [-pi/2, +pi/2].
Example:Notes:
asin(+-0) returns +-0.
asin(x) returns a NAN for |x| > 1.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the principal value of the arc sine of x in the range [-pi/2, +pi/2].
Example:
MsgBox str(ASinMBS(5))
asin(+-0) returns +-0.
asin(x) returns a NAN for |x| > 1.
ATan2MBS(x as double, y as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value.
Example:Notes:
atan2(+-0, -0) returns +-pi.
atan2(+-0, +0) returns +-0.
atan2(+-0, x) returns +-pi for x < 0.
atan2(+-0, x) returns +-0 for x > 0.
atan2(y, +-0) returns -pi/2 for y > 0.
atan2(+-y, -infinity) returns +-pi for finite y > 0.
atan2(+-y, +infinity) returns +-0 for finite y > 0.
atan2(+-infinity, +x) returns +-pi/2 for finite x.
atan2(+-infinity, -infinity) returns +-3*pi/4.
atan2(+-infinity, +infinity) returns +-pi/4.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the principal value of the arc tangent of y/x, using the signs of both arguments to determine the quadrant of the return value.
Example:
MsgBox str(ATan2MBS(3,4))
atan2(+-0, -0) returns +-pi.
atan2(+-0, +0) returns +-0.
atan2(+-0, x) returns +-pi for x < 0.
atan2(+-0, x) returns +-0 for x > 0.
atan2(y, +-0) returns -pi/2 for y > 0.
atan2(+-y, -infinity) returns +-pi for finite y > 0.
atan2(+-y, +infinity) returns +-0 for finite y > 0.
atan2(+-infinity, +x) returns +-pi/2 for finite x.
atan2(+-infinity, -infinity) returns +-3*pi/4.
atan2(+-infinity, +infinity) returns +-pi/4.
ATanHMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the inverse hyperbolic tangent of the real argument x.
Example:Notes:
atanh(+-0) returns +-0.
atanh(+-1) returns +-infinity.
atanh(x) returns a NaN for |x| > 1.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the inverse hyperbolic tangent of the real argument x.
Example:
MsgBox str(ATanHMBS(5))
atanh(+-0) returns +-0.
atanh(+-1) returns +-infinity.
atanh(x) returns a NaN for |x| > 1.
ATanMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: The atan() function computes the principal value of the arc tangent of x in the range [-pi/2, +pi/2].
Example:Notes:
atan(+-0) returns +-0.
atan(+-infinity) returns +-pi/2.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: The atan() function computes the principal value of the arc tangent of x in the range [-pi/2, +pi/2].
Example:
MsgBox str(ATanMBS(5))
atan(+-0) returns +-0.
atan(+-infinity) returns +-pi/2.
BitClearMBS(value as Integer, mask as integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 6.0, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Clears the bits in the mask from the value.
Example:Notes: Does not work for 64 bit integers.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 6.0, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Clears the bits in the mask from the value.
Example:
MsgBox bin(BitClearMBS(&b1111,&b0110)) // 1001
BitCountMBS(value as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 6.0, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Counts the number of bits set.
Example:
Notes: Does not work for 64 bit integers.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 6.0, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Counts the number of bits set.
Example:
MsgBox str(BitCountMBS(&b101)) // 2
MsgBox str(BitCountMBS(&b10101)) // 5
MsgBox str(BitCountMBS(&b11111111111100001111)) // 16
MsgBox str(BitCountMBS(&hFFFFFFFF)) // 32
BitExclMBS(value as Integer, bitNumber as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function:
Does an bitwiseAnd using the value and bitwisenot of 2^bitNumber.
Or: Switches off the bit bitNumber inside value.
Example:
Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function:
Does an bitwiseAnd using the value and bitwisenot of 2^bitNumber.
Or: Switches off the bit bitNumber inside value.
Example:
msgBox str(BitExclMBS(80,4))
' displays 64 which is 80 without 16 = 2^4+2^5 without 2^4
Some examples using this method:
BitInclMBS(value as Integer, bitNumber as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function:
Does an bitwiseOr using the value and 2^bitNumber
Or: Switches on the bit bitNumber inside value.
Example:
Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function:
Does an bitwiseOr using the value and 2^bitNumber
Or: Switches on the bit bitNumber inside value.
Example:
msgBox str(BitInclMBS(64,4))
' displays 80 which is 64 + 16 = 64 + 2^4
Some examples using this method:
BitIsSetMBS(value as Integer, bitNumber as Integer) as Boolean
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Tests whether a certain bit is set inside the value
Example:
Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Tests whether a certain bit is set inside the value
Example:
dim bool as boolean
bool=BitIsSetMBS(80,4)
' true, because 2^4=16 is included in 80=2^4+2^5
Some examples using this method:
BitValMBS(bitNumber as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns 2^bitNumber
Example:
Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns 2^bitNumber
Example:
msgBox str(BitValMBS(5))
' displays 32
Some examples using this method:
BitwiseDiffMBS(x as Integer, y as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns all bits of val1 which are not in val2.
Example:
Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns all bits of val1 which are not in val2.
Example:
msgBox str(BitwiseDiffMBS(65,80))
' displays 1, because 65=2^0+2^5 includes 1=2^0, which is not part of 80=2^4+2^5.
BitwiseNAndMBS(x as Integer, y as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: negates both values and does bitwiseAnd on them.
Example:
Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: negates both values and does bitwiseAnd on them.
Example:
msgBox str(bitwiseNandMBS(65,80))
' displays -82
BitwiseNOrMBS(x as Integer, y as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: negates both values and does bitwiseor on them.
Example:
Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: negates both values and does bitwiseor on them.
Example:
msgBox str(bitwisenorMBS(65,80))
' displays -65
BitwiseNotMBS(value as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Does an bitwise negation of value.
Example:
Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Does an bitwise negation of value.
Example:
msgBox str(BitwiseNotMBS(5))
' displays -6
Some examples using this method:
BitwiseRotateMBS(value as Integer, count as Integer, offset as Integer, width as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Does an bitwise rotation of value.
Example:
Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Does an bitwise rotation of value.
Example:
msgBox str(BitwiseRotateMBS(5,2,0,32))
' displays 20
Some examples using this method:
CopySignMBS(x as double, y as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This functions return x with its sign changed to y's.
Example:Notes: copysign(x, y) returns a NaN (with y's sign) if x is a NaN.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This functions return x with its sign changed to y's.
Example:
MsgBox str(CopySignMBS(3,5))
CosHMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the hyperbolic cosine of x.
Example:Notes:
cosh(+-0) returns 1.
cosh(+-infinity) returns +infinity.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the hyperbolic cosine of x.
Example:
MsgBox str(CosHMBS(5))
cosh(+-0) returns 1.
cosh(+-infinity) returns +infinity.
Some examples using this method:
CosMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the cosine of x (measured in radians).
Example:Notes:
cos(+-0) returns 1.
cos(+-infinity) returns a NaN.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the cosine of x (measured in radians).
Example:
MsgBox str(CosMBS(5))
cos(+-0) returns 1.
cos(+-infinity) returns a NaN.
DoubleToExtendedStrMBS(x as double) as string
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Returns the double as an 80bit Float stored inside a ten byte string.
Example:
Notes: Returns "" if there is not enough memory to create the string.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Returns the double as an 80bit Float stored inside a ten byte string.
Example:
dim s as string
dim d as double
d=5
s=DoubleToExtendedStrMBS(d)
msgBox s
d=extendedStrToDoubleMBS(s)
msgBox str(d)
Exp2MBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes 2^x, the base-2 exponential of x.
Example:Notes:
exp2(+-0) return 1.
exp2(-infinity) return +0.
exp2(+infinity) return +infinity.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes 2^x, the base-2 exponential of x.
Example:
MsgBox str(Exp2MBS(5))
exp2(+-0) return 1.
exp2(-infinity) return +0.
exp2(+infinity) return +infinity.
ExpMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes e^x, the base-e exponential of x.
Example:Notes:
exp(+-0) return 1.
exp(-infinity) return +0.
exp(+infinity) return +infinity.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes e^x, the base-e exponential of x.
Example:
MsgBox str(ExpMBS(5))
exp(+-0) return 1.
exp(-infinity) return +0.
exp(+infinity) return +infinity.
ExtendedStrToDoubleMBS(v as string) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Returns the 80bit Float as a double.
Example:
Notes:
Returns NAN (255) if the string is not valid. e.g. "".
Returns always NAN on Windows.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Does nothing, Linux x86: Does nothing, Feedback.
Function: Returns the 80bit Float as a double.
Example:
dim s as string
dim d as double
d=5
s=DoubleToExtendedStrMBS(d)
msgBox s
d=extendedStrToDoubleMBS(s)
msgBox str(d)
Returns NAN (255) if the string is not valid. e.g. "".
Returns always NAN on Windows.
FacMBS(x as integer) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Calculates (value!).
Example:
Notes:
msgBox str(facMBS(5))
' displays 120 which is 1*2*3*4*5
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Calculates (value!).
Example:
Sub Open()
// Fill a listbox with Fac values:
dim x as integer
dim y as double
for x=1 to 100
listBox1.addrow format(x,"0")
y=FacMBS(x)
if y=0 then
exit
else
listBox1.cell(listBox1.lastIndex,1)=format(y,"0")
end if
next
End Sub
msgBox str(facMBS(5))
' displays 120 which is 1*2*3*4*5
FDimMBS(x as double, y as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This functions return the "positive difference" between their arguments: x - y if x > y, +0 if x is less than or equal to y.
Example:
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This functions return the "positive difference" between their arguments: x - y if x > y, +0 if x is less than or equal to y.
Example:
MsgBox str(FDimMBS(5,3))
FloorMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function returns the largest integral value less than or equal to x.
Example:Notes:
floor(+-0) returns +-0.
floor(+-infinity) returns +-infinity.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function returns the largest integral value less than or equal to x.
Example:
MsgBox str(FloorMBS(5.45))
floor(+-0) returns +-0.
floor(+-infinity) returns +-infinity.
FRExpMBS(inputx as double, byref expValue as integer) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Breaks floating-point number into normalized fraction and power of 2.
Example:
Notes:
This functions break the floating-point number value into a normalized fraction and an integral power of 2. They store the integer in the int object pointed to by exp.
The functions return a number x such that x has a magnitude in the interval [1/2, 1) or 0, and value = x*(2^exp).
frexp(+-0, exp) returns +-0, and stores 0 in the object pointed to by exp.
frexp(+-infinity, exp) returns +-infinity, and stores an unspecified value in the object pointed to by exp.
frexp(Nan, exp) returns a Nan, and stores an unspecified value in the object pointed to by exp.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Breaks floating-point number into normalized fraction and power of 2.
Example:
dim x as Double = 123.456
dim y as integer
dim r as Double = FRExpMBS(x, y)
MsgBox str(X)+": "+str(y)+" "+str(r)
This functions break the floating-point number value into a normalized fraction and an integral power of 2. They store the integer in the int object pointed to by exp.
The functions return a number x such that x has a magnitude in the interval [1/2, 1) or 0, and value = x*(2^exp).
frexp(+-0, exp) returns +-0, and stores 0 in the object pointed to by exp.
frexp(+-infinity, exp) returns +-infinity, and stores an unspecified value in the object pointed to by exp.
frexp(Nan, exp) returns a Nan, and stores an unspecified value in the object pointed to by exp.
HiWordMBS(i as integer) as integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 3.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns the high word part of the integer.
Example:Notes: equal to bitwiseshiftright(i,16)
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 3.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns the high word part of the integer.
Example:
MsgBox hex(HiWordMBS(&H12345678)) // shows 1234
HypotMBS(x as double, y as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the sqrt(x*x+y*y) without undue overflow or underflow.
Example:Notes:
hypot(x, y) , hypot(y, x) , and hypot(x, -y) are equivalent.
hypot(x, +-0) is equivalent to fabs(x).
hypot(+-infinity, y) returns +infinity even if y is a NaN.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the sqrt(x*x+y*y) without undue overflow or underflow.
Example:
MsgBox str(HypotMBS(3,4)) // shows 5
hypot(x, y) , hypot(y, x) , and hypot(x, -y) are equivalent.
hypot(x, +-0) is equivalent to fabs(x).
hypot(+-infinity, y) returns +infinity even if y is a NaN.
IsFiniteMBS(x as double) as boolean
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns true if the parameter is finite.
Example:
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns true if the parameter is finite.
Example:
dim x as Double
x=1/0
if not isfiniteMBS(x) then
msgbox "the result is Infinite."
end if
IsInfMBS(x as double) as boolean
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns true if the double passed in is an infinity value.
Example:
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 4.2, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns true if the double passed in is an infinity value.
Example:
dim e as double = 0.0000000000000000000000000000000000000000000000001
dim d as Double = 1.0/e/e/e/e/e/e/e
MsgBox str(d)+" is inf: "+str(IsInfMBS(d))
IsNANMBS(x as double) as boolean
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns true if the parameter is not a number.
Example:
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns true if the parameter is not a number.
Example:
dim x as Double
x=sqrt(-1)
if isnanMBS(x) then
msgbox "the square root of -1 is not correct."
end if
Log10MBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the value of the logarithm of argument x to base 10.
Example:Notes:
log10(1) return +0.
log10(x) return a NaN for x < 0.
log10(+infinity) return +infinity.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the value of the logarithm of argument x to base 10.
Example:
MsgBox str(Log10MBS(5))
log10(1) return +0.
log10(x) return a NaN for x < 0.
log10(+infinity) return +infinity.
Log2MBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the value of the logarithm of argument x to base 2.
Example:Notes:
log2(1) return +0.
log2(x) return a NaN for x < 0.
log2(+infinity) return +infinity.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the value of the logarithm of argument x to base 2.
Example:
MsgBox str(Log2MBS(5))
log2(1) return +0.
log2(x) return a NaN for x < 0.
log2(+infinity) return +infinity.
LogicalShiftMBS(value as Integer, count as Integer) as Integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Does an logical Shift of value and doesn't take care for the sign (+ or -).
Example:Notes: Always using 32bit.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Does an logical Shift of value and doesn't take care for the sign (+ or -).
Example:
msgbox str(LogicalShiftMBS(5,3))
Some examples using this method:
LogMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the value of the logarithm of argument x to base e.
Example:Notes:
log(1) return +0.
log(x) return a NaN for x < 0.
log(+infinity) return +infinity.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the value of the logarithm of argument x to base e.
Example:
MsgBox str(LogMBS(5))
log(1) return +0.
log(x) return a NaN for x < 0.
log(+infinity) return +infinity.
LoWordMBS(i as integer) as integer
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 3.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns the low word part of the integer.
Example:Notes: equal to bitwiseand(i,&HFFFF)
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 3.1, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: Returns the low word part of the integer.
Example:
MsgBox hex(LoWordMBS(&H12345678)) // shows 5678
PowMBS(x as double, y as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes x raised to the power y.
Example:Notes:
pow(+-0, y) returns +-infinity for y an odd integer < 0.
pow(+-0, y) returns +infinity for y < 0 and not an odd integer.
pow(+-0, y) returns +-0 for y an odd integer > 0.
pow(+-0, y) returns +0 for y > 0 and not an odd integer.
pow(-1, +-infinity) returns 1.
pow(1, y) returns 1 for any y, even a NaN.
pow(x, +-0) returns 1 for any x, even a NaN.
pow(x, y) returns a NaN for finite x < 0 and finite non-integer y.
pow(x, -infinity) returns +infinity for |x| < 1.
pow(x, -infinity) returns +0 for |x| > 1.
pow(x, +infinity) returns +0 for |x| < 1.
pow(x, +infinity) returns +infinity for |x| > 1.
pow(-infinity, y) returns -0 for y an odd integer < 0.
pow(-infinity, y) returns +0 for y < 0 and not an odd integer.
pow(-infinity, y) returns -infinity for y an odd integer > 0.
pow(-infinity, y) returns +infinity for y > 0 and not an odd integer.
pow(+infinity, y) returns +0 for y < 0.
pow(+infinity, y) returns +infinity for y > 0.
Range errors may occur.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes x raised to the power y.
Example:
MsgBox str(PowMBS(5,5))
pow(+-0, y) returns +-infinity for y an odd integer < 0.
pow(+-0, y) returns +infinity for y < 0 and not an odd integer.
pow(+-0, y) returns +-0 for y an odd integer > 0.
pow(+-0, y) returns +0 for y > 0 and not an odd integer.
pow(-1, +-infinity) returns 1.
pow(1, y) returns 1 for any y, even a NaN.
pow(x, +-0) returns 1 for any x, even a NaN.
pow(x, y) returns a NaN for finite x < 0 and finite non-integer y.
pow(x, -infinity) returns +infinity for |x| < 1.
pow(x, -infinity) returns +0 for |x| > 1.
pow(x, +infinity) returns +0 for |x| < 1.
pow(x, +infinity) returns +infinity for |x| > 1.
pow(-infinity, y) returns -0 for y an odd integer < 0.
pow(-infinity, y) returns +0 for y < 0 and not an odd integer.
pow(-infinity, y) returns -infinity for y an odd integer > 0.
pow(-infinity, y) returns +infinity for y > 0 and not an odd integer.
pow(+infinity, y) returns +0 for y < 0.
pow(+infinity, y) returns +infinity for y > 0.
Range errors may occur.
RoundMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function returns the integral value nearest to x rounding half-way cases away from zero, regardless of the current rounding direction.
Example:Notes:
round(+-0) returns +-0.
round(+-infinity) returns +-infinity.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function returns the integral value nearest to x rounding half-way cases away from zero, regardless of the current rounding direction.
Example:
MsgBox str(RoundMBS(5.5))
round(+-0) returns +-0.
round(+-infinity) returns +-infinity.
SinHMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the hyperbolic sine of x.
Example:Notes:
sinh(+-0) returns +-0.
sinh(+-infinity) returns +-infinity.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the hyperbolic sine of x.
Example:
MsgBox str(SinHMBS(5.5))
sinh(+-0) returns +-0.
sinh(+-infinity) returns +-infinity.
SinMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the sine of x (measured in radians).
Example:Notes:
sin(+-0) returns +-0.
sin(+-infinity) returns a NaN.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the sine of x (measured in radians).
Example:
MsgBox str(SinMBS(5.5))
sin(+-0) returns +-0.
sin(+-infinity) returns a NaN.
SqrtMBS(x as double, y as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function compute the yth root of x.
Example:
Notes:
sqrt(-0) returns -0.
sqrt(x,y) returns a NaN if the root can't be calculated.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Plugin version: 5.3, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function compute the yth root of x.
Example:
dim r,x,y as double
r=SqrtMBS(x,y)
// r^y=x
sqrt(-0) returns -0.
sqrt(x,y) returns a NaN if the root can't be calculated.
TanHMBS(x as double) as double
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the hyperbolic tangent of x.
Example:Notes:
tanh(+-0) returns +-0.
tanh(+-infinity) returns +-1.
global method, Math, MBS REALbasic Util Plugin (Math), Console safe, Mac OS X: Works, Windows: Works, Linux x86: Works, Feedback.
Function: This function computes the hyperbolic tangent of x.
Example:
MsgBox str(TanHMBS(5.5))
tanh(+-0) returns +-0.
tanh(+-infinity) returns +-1.
The items on this page are in the following plugins: MBS REALbasic Util Plugin.
Links
MBS Realbasic Plugins - Pfarrgemeinde St. Arnulf Nickenich