Xojo Conferences
 MBS Oct 2019 Cologne DE

Platforms to show: All Mac Windows Linux Cross-Platform

ACosHMBS(x as Double) as Double
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
Function: This function computes the inverse hyperbolic cosine of the real argument x.
Example:
```MsgBox str(ACosHMBS(5))
```
Notes:
acosh(1) returns +0.
acosh(x) returns a NAN for x < 1.
acosh(+infinity) returns +infinity.

ACosMBS(x as Double) as Double
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 5.3 Yes Yes Yes Yes No
Function: This function computes the principal value of the arc cosine of x in the range [0, pi].
Example:
```MsgBox str(ACosMBS(5))
```
Notes:
acos(1) returns +0.
acos(x) returns a NAN for |x| > 1.

Blog Entries

ArithmeticShiftMBS(value as UInt64, count as Integer) as UInt64
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
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
```
Notes: Always using 32bit.

Some examples using this method:

ASinHMBS(x as Double) as Double
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
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))
```
Notes:
asin(+-0) returns +-0.
asin(x) returns a NAN for |x| > 1.

ASinMBS(x as Double) as Double
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 5.3 Yes Yes Yes Yes No
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))
```
Notes:
asin(+-0) returns +-0.
asin(x) returns a NAN for |x| > 1.

Blog Entries

ATan2MBS(x as Double, y as Double) as Double
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 5.3 Yes Yes Yes Yes No
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))
```
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.

Blog Entries

ATanHMBS(x as Double) as Double
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
Function: This function computes the inverse hyperbolic tangent of the real argument x.
Example:
```MsgBox str(ATanHMBS(5))
```
Notes:
atanh(+-0) returns +-0.
atanh(+-1) returns +-infinity.
atanh(x) returns a NaN for |x| > 1.

ATanMBS(x as Double) as Double
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 5.3 Yes Yes Yes Yes No
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))
```
Notes:
atan(+-0) returns +-0.
atan(+-infinity) returns +-pi/2.

Blog Entries

BitClearMBS(value as UInt64, mask as UInt64) as UInt64
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 6.0 Yes Yes Yes Yes No
Function: Clears the bits in the mask from the value.
Example:
```MsgBox bin(BitClearMBS(&b1111,&b0110)) // 1001
```
Notes: Does not work for 64 bit integers.

BitCountMBS(value as UInt64) as Integer
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 6.0 Yes Yes Yes Yes No
Function: Counts the number of bits set.
Example:
```MsgBox str(BitCountMBS(&b101)) // 2MsgBox str(BitCountMBS(&b10101)) // 5MsgBox str(BitCountMBS(&b11111111111100001111)) // 16MsgBox str(BitCountMBS(&hFFFFFFFF)) // 32
```
Notes: Does not work for 64 bit integers.

BitExclMBS(value as UInt64, bitNumber as Integer) as UInt64
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
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
```
Notes: Always using 64-bit.

Some examples using this method:

Blog Entries

BitInclMBS(value as UInt64, bitNumber as Integer) as UInt64
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
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
```
Notes: Always using 64-bit.

Some examples using this method:

Blog Entries

BitIsSetMBS(value as UInt64, bitNumber as Integer) as Boolean
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
Function: Tests whether a certain bit is set inside the value
Example:
```dim bool as booleanbool=BitIsSetMBS(80,4)' true, because 2^4=16 is included in 80=2^4+2^6
```
Notes: Always using 64-bit.

Some examples using this method:

Blog Entries

BitValMBS(bitNumber as Integer) as UInt64
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
Function: Returns 2^bitNumber
Example:
```msgBox str(BitValMBS(5))' displays 32
```
Notes: Always using 64-bit.

Some examples using this method:

Blog Entries

BitwiseDiffMBS(x as UInt64, y as UInt64) as UInt64
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
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.
```
Notes: Always using 32bit.

BitwiseNAndMBS(x as UInt64, y as UInt64) as UInt64
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
Function: negates both values and does bitwiseAnd on them.
Example:
```msgBox str(bitwiseNandMBS(65,80))' displays -82
```
Notes: Always using 32bit.

BitwiseNOrMBS(x as UInt64, y as UInt64) as UInt64
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
Function: negates both values and does bitwiseor on them.
Example:
```msgBox str(bitwisenorMBS(65,80))' displays -65
```
Notes: Always using 32bit.

BitwiseNotMBS(value as UInt64) as UInt64
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
Function: Does an bitwise negation of value.
Example:
```msgBox str(BitwiseNotMBS(5))' displays -6
```
Notes: Always using 32bit.

Some examples using this method:

BitwiseRotateMBS(value as UInt64, count as Integer, offset as Integer, width as Integer) as UInt64
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes Yes Yes Yes No
Function: Does an bitwise rotation of value.
Example:
```msgBox str(BitwiseRotateMBS(5,2,0,32))' displays 20
```
Notes: Always using 32bit.

Some examples using this method:

ConvertFromFloat16MBS(Number as UInt16) as Single
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 15.0 Yes Yes Yes Yes No
Function: Converts a 16bit floating point number to a 32bit floating point number.
Example:
```dim h1 as UInt16 = ConvertToFloat16MBS(1.0)dim f1 as single = ConvertFromFloat16MBS(h1) // should be 1.0dim h2 as UInt16 = ConvertToFloat16MBS(-1.0)dim f2 as single = ConvertFromFloat16MBS(h2) // should be -1.0dim h3 as UInt16 = ConvertToFloat16MBS(1000.0)dim f3 as single = ConvertFromFloat16MBS(h3) // should be 1000.0dim h4 as UInt16 = ConvertToFloat16MBS(-1000.0)dim f4 as single = ConvertFromFloat16MBS(h4) // should be -1000.0dim inf as single = 65504.0dim h5 as UInt16 = ConvertToFloat16MBS(inf)dim f5 as single = ConvertFromFloat16MBS(h5) // should be 65504dim nan as single = sqrt(-1)dim h6 as UInt16 = ConvertToFloat16MBS(nan)dim f6 as single = ConvertFromFloat16MBS(h6) // should be NANBreak // check in debugger
```

Blog Entries

ConvertToFloat16MBS(Number as Single) as UInt16
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 15.0 Yes Yes Yes Yes No
Function: Converts a 32bit floating point number to a 16bit floating point number.
Example:
```dim h1 as UInt16 = ConvertToFloat16MBS(1.0)dim f1 as single = ConvertFromFloat16MBS(h1) // should be 1.0dim h2 as UInt16 = ConvertToFloat16MBS(-1.0)dim f2 as single = ConvertFromFloat16MBS(h2) // should be -1.0dim h3 as UInt16 = ConvertToFloat16MBS(1000.0)dim f3 as single = ConvertFromFloat16MBS(h3) // should be 1000.0dim h4 as UInt16 = ConvertToFloat16MBS(-1000.0)dim f4 as single = ConvertFromFloat16MBS(h4) // should be -1000.0dim inf as single = 65504.0dim h5 as UInt16 = ConvertToFloat16MBS(inf)dim f5 as single = ConvertFromFloat16MBS(h5) // should be 65504dim nan as single = sqrt(-1)dim h6 as UInt16 = ConvertToFloat16MBS(nan)dim f6 as single = ConvertFromFloat16MBS(h6) // should be NANBreak // check in debugger
```
Notes: This looses precision as 16bit fit less bits than 32 bit.

Blog Entries

CosHMBS(x as Double) as Double
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 5.3 Yes Yes Yes Yes No
Function: This function computes the hyperbolic cosine of x.
Example:
```MsgBox str(CosHMBS(5))
```
Notes:
cosh(+-0) returns 1.
cosh(+-infinity) returns +infinity.

Some examples using this method:

Blog Entries

CosMBS(x as Double) as Double
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 5.3 Yes Yes Yes Yes No
Function: This function computes the cosine of x (measured in radians).
Example:
```MsgBox str(CosMBS(5))
```
Notes:
cos(+-0) returns 1.
cos(+-infinity) returns a NaN.

Blog Entries

CurrencyAddMBS(value1 as Currency, value2 as Currency) as Currency
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 14.3 Yes Yes Yes Yes No
Notes: This function uses 64bit integer math to avoid rounding issues.

CurrencyDivMBS(value1 as Currency, value2 as Integer) as Currency
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 14.3 Yes Yes Yes Yes No
Function: Divides currency value by integer.
Notes:
Rest is ignored.
This function uses 64bit integer math to avoid rounding issues.

CurrencyMulMBS(value1 as Currency, value2 as Integer) as Currency
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 14.3 Yes Yes Yes Yes No
Function: Multiplies currency value with integer.
Example:
```dim c1 as Currency =    1234567890.1234// in xojodim c3 as Currency = c1 * 12345// with plugindim c4 as Currency = CurrencyMulMBS(c1, 12345)// verify by 64bit mathdim c5 as Int64 =  12345678901234dim c6 as int64 = c5 * 12345// and plugin is correctMsgBox str(c3)+" "+str(c4)+" "+str(c6)
```
Notes: This function uses 64bit integer math to avoid rounding issues.

CurrencySubMBS(value1 as Currency, value2 as Currency) as Currency
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 14.3 Yes Yes Yes Yes No
Function: Subtracts value2 from value1.
Notes: This function uses 64bit integer math to avoid rounding issues.

CurrencyValueMBS(value as string) as Currency
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin 14.3 Yes Yes Yes Yes No
Function: Parses string into currency value.
Notes: Replacement for val() which works better with large numbers and raises exceptions on errors.

Some examples using this method:

Blog Entries

DoubleToExtendedStrMBS(x as Double) as string
 Type Topic Plugin Version macOS Windows Linux Console & Web iOS global method Math MBS Util Plugin Yes No No Yes, macOS only No
Function: Returns the double as an 80bit Float stored inside a ten byte string.
Example:
```dim s as stringdim d as Doubled=5s=DoubleToExtendedStrMBS(d)msgBox sd=extendedStrToDoubleMBS(s)msgBox str(d)
```
Notes: Returns "" if there is not enough memory to create the string. 