Engineering
- Source
Members
(static) erfcPrecise
- Source
- See
- erfc.precise
(static) erfPrecise
- Source
- See
- erf.precise
Methods
(inner) besselI(x, order) → {number}
Returns the modified Bessel function In(x).
Name | Type | Description |
---|---|---|
x | number | The value at which to evaluate the function |
order | number | The order of the Bessel function. If order is not an integer, it is truncated |
- Source
- See
- For further information, see docs.oasis-open.org
The calculated modified Bessel function for the given value of x and the specified order
- Type:
- number
rosettajs.besselI(2.6, 1) // returns 2.7553843378955585
(inner) besselJ(x, order) → {number}
Returns the Bessel function Jn(x).
Name | Type | Description |
---|---|---|
x | number | The value at which to evaluate the function |
order | number | The order of the Bessel function. If order is not an integer, it is truncated |
- Source
- See
- For further information, see docs.oasis-open.org
The calculated Bessel function for the given value of x and the specified order
- Type:
- number
rosettajs.besselJ(2.6, 1) // returns 0.47081826649775615
(inner) besselK(x, order) → {number}
Returns the modified Bessel function Kn(x).
Name | Type | Description |
---|---|---|
x | number | The value at which to evaluate the function. |
order | number | The order of the Bessel function. If order is not an integer, it is truncated |
- Source
- See
- For further information, see docs.oasis-open.org
The calculated Bessel function for the given value of x and the specified order
- Type:
- number
rosettajs.besselK(2.6, 1) // returns 0.0652840440474331
(inner) besselY(x, order) → {number}
Returns the Bessel function Yn(x).
Name | Type | Description |
---|---|---|
x | number | The value at which to evaluate the function |
order | number | The order of the function. If order is not an integer, it is truncated |
- Source
- See
- For further information, see docs.oasis-open.org
The calculated Bessel function for the given value of x and the specified order
- Type:
- number
rosettajs.besselY(2.6, 1) // returns 0.18836354378844533
(inner) bin2Dec(number) → {number}
Converts a binary number to decimal.
Name | Type | Description |
---|---|---|
number | number | The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation. |
- Source
- See
- For further information, see docs.oasis-open.org
A decimal for the given binary number
- Type:
- number
rosettajs.bin2Dec(1100001) // returns 97
(inner) bin2Hex(number, placesopt) → {string}
Converts a binary number to hexadecimal.
Name | Type | Attributes | Description |
---|---|---|---|
number | number | The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation. | |
places | number | <optional> | The number of characters to use. If places is omitted, bin2Hex uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
- Source
- See
- For further information, see docs.oasis-open.org
A hexadecimal for the given binary number
- Type:
- string
rosettajs.bin2Hex(11111011) // returns fb
rosettajs.bin2Hex(11111011, 4) // returns 00fb
(inner) bin2Oct(number, placesopt) → {string}
Converts a binary number to octal.
Name | Type | Attributes | Description |
---|---|---|---|
number | number | The binary number you want to convert. Number cannot contain more than 10 characters (10 bits). The most significant bit of number is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation. | |
places | number | <optional> | The number of characters to use. If places is omitted, bin2Oct uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
- Source
- See
- For further information, see docs.oasis-open.org
A octal for the given binary number
- Type:
- string
rosettajs.bin2Oct(1001) // returns 11
rosettajs.bin2Oct(1001, 4) // returns 0011
(inner) bitAnd(number1, number2) → {number}
Returns a bitwise 'AND' of two numbers.
Name | Type | Description |
---|---|---|
number1 | number | A decimal greater than or equal to 0 |
number2 | number | A decimal greater than or equal to 0 |
- Source
- See
- For further information, see docs.oasis-open.org
A decimal that is a bitwise 'AND' of the 2 given numbers
- Type:
- number
rosettajs.bitAnd(7,29) // returns 5
(inner) bitLShift(number, shift) → {number}
Returns a value number shifted left by shift_amount bits.
Name | Type | Description |
---|---|---|
number | number | A integer greater than or equal to 0 |
shift | number | A integer indicating amount of bits to shift |
- Source
- See
- For further information, see docs.oasis-open.org
A decimal representing the specified number shifted left by specified amount of bits
- Type:
- number
rosettajs.bitLShift(5,3) // returns 40
(inner) bitOr(number1, number2) → {number}
Returns a bitwise 'OR' of two numbers.
Name | Type | Description |
---|---|---|
number1 | number | A decimal greater than or equal to 0 |
number2 | number | A decimal greater than or equal to 0 |
- Source
- See
- For further information, see docs.oasis-open.org
A decimal that is a bitwise 'OR' of the 2 given numbers
- Type:
- number
rosettajs.bitOr(7,29) // returns 31
(inner) bitRShift(number, shift) → {number}
Returns a value number shifted right by shift_amount bits.
Name | Type | Description |
---|---|---|
number | number | A integer greater than or equal to 0 |
shift | number | A integer indicating amount of bits to shift |
- Source
- See
- For further information, see docs.oasis-open.org
A decimal representing the specified number shifted right by specified amount of bits
- Type:
- number
rosettajs.bitRShift(29,2) // returns 7
(inner) bitXOr(number1, number2) → {number}
Returns a bitwise 'XOR' of two numbers.
Name | Type | Description |
---|---|---|
number1 | number | A decimal greater than or equal to 0 |
number2 | number | A decimal greater than or equal to 0 |
- Source
- See
- For further information, see docs.oasis-open.org
A decimal that is a bitwise 'XOR' of the 2 given numbers
- Type:
- number
rosettajs.bitXOr(7,29) // returns 26
(inner) complex(real, imaginary, suffixopt) → {string|number}
Converts real and imaginary coefficients into a complex number.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
real | number | The real coefficient of the complex number | ||
imaginary | number | The imaginary coefficient of the complex number | ||
suffix | String | <optional> | i | The suffix, either lowercase "i" or "j", for the imaginary component of the complex number. If omitted, suffix is assumed to be "i". |
- Source
- See
- For further information, see docs.oasis-open.org
A complex number from the given real and imaginary coefficient numbers
- Type:
- string |
number
rosettajs.complex(4,5) // returns 4+5i
rosettajs.complex(4,5,"j") // returns 4+5j
(inner) convert(number, from_unit, to_unit) → {number}
Converts a number from one measurement system to another.
Name | Type | Description |
---|---|---|
number | number | The value in from_units to convert |
from_unit | number | The units for number |
to_unit | number | The units for the result |
- Source
- See
- For further information, see docs.oasis-open.org
A number representing conversion from one measurement system to another
- Type:
- number
rosettajs.convert(1, "lbm", "kg") // returns 0.45359237
(inner) dec2Bin(number, placesopt) → {number}
Converts a decimal number to binary.
Name | Type | Attributes | Description |
---|---|---|---|
number | number | The decimal integer you want to convert. If number is negative, valid place values are ignored and dec2Bin returns a 10-character (10-bit) binary number in which the most significant bit is the sign bit. The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation. | |
places | number | <optional> | The number of characters to use. If places is omitted, dec2Bin uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
- Source
- See
- For further information, see docs.oasis-open.org
A binary for the given decimal number
- Type:
- number
rosettajs.dec2Bin(10,5) // returns 01010
rosettajs.dec2Bin(-90) // returns 1110100110
(inner) dec2Hex(number, placesopt) → {string}
Converts a decimal number to hexadecimal.
Name | Type | Attributes | Description |
---|---|---|---|
number | number | The decimal integer you want to convert. If number is negative, places is ignored and dec2Hex returns a 10-character (40-bit) hexadecimal number in which the most significant bit is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation. | |
places | number | <optional> | The number of characters to use. If places is omitted, dec2Hex uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
- Source
- See
- For further information, see docs.oasis-open.org
A hexadecimal for the given decimal number
- Type:
- string
rosettajs.dec2Hex(90, 4) // returns 005a
rosettajs.dec2Hex(-75) // returns ffffffffb5
(inner) dec2Oct(number, placesopt) → {number}
Converts a decimal number to octal.
Name | Type | Attributes | Description |
---|---|---|---|
number | number | The decimal integer you want to convert. If number is negative, places is ignored and dec2Oct returns a 10-character (30-bit) octal number in which the most significant bit is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation. | |
places | number | <optional> | The number of characters to use. If places is omitted, dec2Oct uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
- Source
- See
- For further information, see docs.oasis-open.org
A octal for the given decimal number
- Type:
- number
rosettajs.dec2Oct(78, 3) // returns 116
rosettajs.dec2Oct(-75) // returns 7777777665
(inner) delta(number1, number2opt) → {number}
Tests whether two values are equal.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
number1 | number | The first number | ||
number2 | number | <optional> | 0 | The second number. If omitted, number2 is assumed to be zero. |
- Source
- See
- For further information, see docs.oasis-open.org
1 if number1 = number2; returns 0 otherwise
- Type:
- number
rosettajs.delta(6, 4) // returns 0
rosettajs.delta(8, 8) // returns 1
(inner) erf(lower_bound, upper_boundopt) → {number}
Returns the error function integrated between lower_limit and upper_limit.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
lower_bound | number | The lower bound for integrating ERF | ||
upper_bound | number | <optional> | 0 | The upper bound for integrating ERF. If omitted, ERF integrates between zero and lower_limit. |
- Source
- See
- For further information, see docs.oasis-open.org
The error function integrated between lower_limit and upper_limit
- Type:
- number
rosettajs.erf(0.875) // returns 0.7840750610598597
(inner) erfc(x) → {number}
Returns the complementary error function.
Name | Type | Description |
---|---|---|
x | number | The lower bound for integrating ERFC |
- Source
- See
- For further information, see docs.oasis-open.org
Complementary ERF of provided number
- Type:
- number
rosettajs.erfc(2) // returns 0.004677734981047288
(inner) geStep(number, stepopt) → {number}
Tests whether a number is greater than a threshold value.
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
number | number | The value to test against step | ||
step | number | <optional> | 0 | The threshold value. If you omit a value for step, geStep uses zero. |
- Source
- See
- For further information, see docs.oasis-open.org
1 if number ≥ step; returns 0 (zero) otherwise.
- Type:
- number
rosettajs.geStep(6) // returns 1
rosettajs.geStep(6,8) // returns 0
(inner) hex2Bin(number, placesopt) → {string}
Converts a hexadecimal number to binary.
Name | Type | Attributes | Description |
---|---|---|---|
number | string | The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit (40th bit from the right). The remaining 9 bits are magnitude bits. Negative numbers are represented using two's-complement notation. | |
places | number | <optional> | The number of characters to use. If places is omitted, hex2Bin uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
- Source
- See
- For further information, see docs.oasis-open.org
A binary for the given hexadecimal
- Type:
- string
rosettajs.hex2Bin("B") // returns 1011
rosettajs.hex2Bin("B",10) // returns 0000001011
(inner) hex2Dec(number) → {number}
Converts a hexadecimal number to decimal.
Name | Type | Description |
---|---|---|
number | string | The hexadecimal number you want to convert. Number cannot contain more than 10 characters (40 bits). The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation. |
- Source
- See
- For further information, see docs.oasis-open.org
A decimal for the given hexadecimal number
- Type:
- number
rosettajs.hex2Dec("A6") // returns 166
(inner) hex2Oct(number, placesopt) → {string}
Converts a hexadecimal number to octal
Name | Type | Attributes | Description |
---|---|---|---|
number | string | The hexadecimal number you want to convert. Number cannot contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 39 bits are magnitude bits. Negative numbers are represented using two's-complement notation. | |
places | number | <optional> | The number of characters to use. If places is omitted, hex2Oct uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
- Source
- See
- For further information, see docs.oasis-open.org
A octal for the given hexadecimal number
- Type:
- string
rosettajs.hex2Oct("B") // returns 13
rosettajs.hex2Oct("B",10) // 0000000013
(inner) imAbs(inumber) → {number}
Returns the absolute value (modulus) of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the absolute value |
- Source
- See
- For further information, see docs.oasis-open.org
Absolute value for the given complex number
- Type:
- number
rosettajs.imAbs("9+12i") // returns 15
(inner) imaginary(inumber) → {string|number}
Returns the imaginary coefficient of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the imaginary coefficient |
- Source
- See
- For further information, see docs.oasis-open.org
The imaginary coefficient of the given complex number
- Type:
- string |
number
rosettajs.imaginary("4+5i") // returns 5
rosettajs.imaginary(7) // returns 0
(inner) imArgument(inumber) → {string|number}
Returns the argument theta, an angle expressed in radians.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the argument Theta |
- Source
- See
- For further information, see docs.oasis-open.org
The argument Theta, an angle expressed in radians, for the given complex number
- Type:
- string |
number
rosettajs.imArgument("4+5i") // returns 0.8960553845713439
(inner) imConjugate(inumber) → {string|number}
Returns the complex conjugate of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the conjugate |
- Source
- See
- For further information, see docs.oasis-open.org
The complex conjugate of the given complex number
- Type:
- string |
number
rosettajs.imConjugate("7+4i") // returns 7-4i
(inner) imCos(inumber) → {string|number}
Returns the cosine of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the cosine |
- Source
- See
- For further information, see docs.oasis-open.org
Returns the cosine of the given complex number in x + yi or x + yj text format
- Type:
- string |
number
rosettajs.imCos("7+i") // returns 1.1633319692207098-0.772091435022302i
(inner) imCosh(inumber) → {string|number}
Returns the hyperbolic cosine of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the hyperbolic cosine |
- Source
- See
- For further information, see docs.oasis-open.org
The hyperbolic cosine of the given complex number in x+yi or x+yj text format
- Type:
- string |
number
rosettajs.imCosh("7+i") // returns 296.2569584411429+461.3921082367867i
(inner) imCot(inumber) → {string|number}
Returns the cotangent of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the cotangent |
- Source
- See
- For further information, see docs.oasis-open.org
The cotangent of the given complex number in x+yi or x+yj text format
- Type:
- string |
number
rosettajs.imCot("7+i") // returns 0.27323643702063916-1.0003866917747672i
(inner) imCsc(inumber) → {string|number}
Returns the cosecant of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the cosecant |
- Source
- See
- For further information, see docs.oasis-open.org
The cosecant of a complex number in x+yi or x+yj text format
- Type:
- string |
number
rosettajs.imCsc("7+i") // returns 0.5592579837285742-0.48875850368917295i
(inner) imCsch(inumber) → {string|number}
Returns the hyperbolic cosecant of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the hyperbolic cosecant |
- Source
- See
- For further information, see docs.oasis-open.org
The hyperbolic cosecant of the given complex number in x+yi or x+yj text format
- Type:
- string |
number
rosettajs.imCsch("7+i") // returns 0.0009853823560021253-0.0015346446451764265i
(inner) imDiv(inumber1, inumber2) → {string|number}
Returns the quotient of two complex numbers.
Name | Type | Description |
---|---|---|
inumber1 | string | | The complex numerator or dividend |
inumber2 | string | | The complex denominator or divisor |
- Source
- See
- For further information, see docs.oasis-open.org
The quotient of the two given complex numbers in x + yi or x + yj text format
- Type:
- string |
number
rosettajs.imDiv("-238+240i","10+24i") // returns 5+12i
(inner) imExp(inumber) → {string|number}
Returns the exponential of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the exponential |
- Source
- See
- For further information, see docs.oasis-open.org
The exponential of a complex number in x + yi or x + yj text format
- Type:
- string |
number
rosettajs.imExp("2+i") // returns 3.992324048441272+6.217676312367968i
(inner) imLn(inumber) → {string|number}
Returns the natural logarithm of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the natural logarithm |
- Source
- See
- For further information, see docs.oasis-open.org
The natural logarithm of a complex number in x + yi or x + yj text format
- Type:
- string |
number
rosettajs.imLn("2+i") // returns 0.8047189562170503+0.4636476090008061i
(inner) imLog2(inumber) → {string|number}
Returns the base-2 logarithm of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the base-2 logarithm |
- Source
- See
- For further information, see docs.oasis-open.org
The base-2 logarithm of a complex number in x + yi or x + yj text format
- Type:
- string |
number
rosettajs.imLog2("7+i") // returns 2.821928094887362+0.20471417699417774i
(inner) imLog10(inumber) → {string|number}
Returns the base-10 logarithm of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the common logarithm |
- Source
- See
- For further information, see docs.oasis-open.org
The common logarithm (base 10) of a complex number in x + yi or x + yj text format.
- Type:
- string |
number
rosettajs.imLog10("7+i") // returns 0.8494850021680093+0.06162510781291279i
(inner) imPower(inumber, power) → {string|number}
Returns a complex number raised to an integer power.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number you want to raise to a power |
power | number | The power to which you want to raise the complex number |
- Source
- See
- For further information, see docs.oasis-open.org
A complex number in x + yi or x + yj text format raised to a power
- Type:
- string |
number
rosettajs.imPower("2+2i", 55) // returns 4.835703278458551e+24-4.835703278458541e+24i
(inner) imProduct(…inumbers) → {string|number}
Returns the product of from 2 to 255 complex numbers.
Name | Type | Attributes | Description |
---|---|---|---|
inumbers | Array.<string> | | <repeatable> | Inumber1 is required, subsequent inumbers are not. 1 to 255 complex numbers to multiply |
- Source
- See
- For further information, see docs.oasis-open.org
The product of 1 to 255 complex numbers in x + yi or x + yj text format
- Type:
- string |
number
rosettajs.imProduct("7+2i",55) // returns 385+110i
rosettajs.imProduct("7+2i","9-3i") // returns 69-3i
(inner) imReal(inumber) → {string|number}
Returns the real coefficient of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the real coefficient |
- Source
- See
- For further information, see docs.oasis-open.org
The real coefficient of a complex number in x + yi or x + yj text format
- Type:
- string |
number
rosettajs.imReal("7-3i") // returns 7
(inner) imSec(inumber) → {String}
Returns the secant of a complex number.
Name | Type | Description |
---|---|---|
inumber | number | A complex number for which you want the secant |
- Source
- See
- For further information, see docs.oasis-open.org
The secant of a complex number in x+yi or x+yj text format.
- Type:
- String
rosettajs.imSec("7-3i") // returns 0.07520380314551633-0.06521210988033882i
(inner) imSech(inumber) → {String}
Returns the hyperbolic secant of a complex number.
Name | Type | Description |
---|---|---|
inumber | number | A complex number for which you want the hyperbolic secant. |
- Source
- See
- For further information, see docs.oasis-open.org
The hyperbolic secant of a complex number in x+yi or x+yj text format.
- Type:
- String
rosettajs.imSech("7-3i") // returns -0.0018055112256293788+0.00025736895567555834i
(inner) imSin(inumber) → {string|number}
Returns the sine of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the sine |
- Source
- See
- For further information, see docs.oasis-open.org
The sine of a complex number in x + yi or x + yj text format
- Type:
- string |
number
rosettajs.imSin("7-3i") // returns 6.61431901165645-7.552498491503594i
(inner) imSinh(inumber) → {string|number}
Returns the hyperbolic sine of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the hyperbolic sine |
- Source
- See
- For further information, see docs.oasis-open.org
The hyperbolic sine of a complex number in x+yi or x+yj text format
- Type:
- string |
number
rosettajs.imSinh("7-4i") // returns -358.4033361942234+414.96770042530943i
(inner) imSqrt(inumber) → {string|number}
Returns the square root of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the square root |
- Source
- See
- For further information, see docs.oasis-open.org
The square root of a complex number in x + yi or x + yj text format.
- Type:
- string |
number
rosettajs.imSqrt("7-4i") // returns 2.744290231398508-0.7287858904707711i
(inner) imSub(inumber1, inumber2) → {stirng|number}
Returns the difference between two complex numbers.
Name | Type | Description |
---|---|---|
inumber1 | string | | The complex number from which to subtract inumber2 |
inumber2 | string | | The complex number to subtract from inumber1 |
- Source
- See
- For further information, see docs.oasis-open.org
The difference of two complex numbers in x + yi or x + yj text format
- Type:
- stirng |
number
rosettajs.imSub("15+2i","3+3i") // returns 12-1i
(inner) imSum(…inumbers) → {string|number}
Returns the sum of complex numbers.
Name | Type | Attributes | Description |
---|---|---|---|
inumbers | Array.<string> | | <repeatable> | Inumber1 is required, subsequent inumbers are not. 1 to 255 complex numbers to add |
- Source
- See
- For further information, see docs.oasis-open.org
The sum of two or more complex numbers in x + yi or x + yj text format
- Type:
- string |
number
rosettajs.imSum("7+2i",55) // returns 755+2i
rosettajs.imSum("7+2i","9-3i") // returns 16-1i
(inner) imTan(inumber) → {string|number}
Returns the tangent of a complex number.
Name | Type | Description |
---|---|---|
inumber | string | | A complex number for which you want the tangent |
- Source
- See
- For further information, see docs.oasis-open.org
The tangent of a complex number in x+yi or x+yj text format
- Type:
- string |
number
rosettajs.imTan("7+2i") // returns 0.03609431359326245+0.9943504089532537i
(inner) oct2Bin(number, placesopt) → {number}
Converts an octal number to binary.
Name | Type | Attributes | Description |
---|---|---|---|
number | string | The octal number you want to convert. Number may not contain more than 10 characters. The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation. | |
places | number | <optional> | The number of characters to use. If places is omitted, oct2Bin uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
- Source
- See
- For further information, see docs.oasis-open.org
A binary for the given octal number
- Type:
- number
rosettajs.oct2Bin(7) // returns 111
rosettajs.oct2Bin(7, 5) // returns 00111
(inner) oct2Dec(number) → {number}
Converts an octal number to decimal.
Name | Type | Description |
---|---|---|
number | string | The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation. |
- Source
- See
- For further information, see docs.oasis-open.org
A decimal for the given octal number
- Type:
- number
rosettajs.oct2Dec(64) // returns 52
(inner) oct2Hex(number, placesopt) → {number}
Converts an octal number to hexadecimal.
Name | Type | Attributes | Description |
---|---|---|---|
number | string | The octal number you want to convert. Number may not contain more than 10 octal characters (30 bits). The most significant bit of number is the sign bit. The remaining 29 bits are magnitude bits. Negative numbers are represented using two's-complement notation | |
places | number | <optional> | The number of characters to use. If places is omitted, OCT2HEX uses the minimum number of characters necessary. Places is useful for padding the return value with leading 0s (zeros). |
- Source
- See
- For further information, see docs.oasis-open.org
A hexadecimal for the given octal number
- Type:
- number
rosettajs.oct2Hex(177747533) // returns 1ffcf5b
rosettajs.oct2Hex(74,5) // returns 0003c