http://www.zorba-xquery.com/modules/excel/engineering
import module namespace excel-engineering = "http://www.zorba-xquery.com/modules/excel/engineering";
This is a library module offering the same set of functions defined by Microsoft Excel, under Engineering Functions.
Sorin Nasoi
xquery version "3.0" encoding "utf-8";
- the XQuery module can be found here.
Imported modules:
For more details please also see:
| excel-engineering | http://www.zorba-xquery.com/modules/excel/engineering |
| excel-err | http://www.zorba-xquery.com/modules/excel/errors |
| excel-math | http://www.zorba-xquery.com/modules/excel/math |
| excel-text | http://www.zorba-xquery.com/modules/excel/text |
| ver | http://www.zorba-xquery.com/options/versioning |
|
bin2dec
(
$arg as xs:anyAtomicType
) as xs:integer Converts a binary number to decimal. |
|
|
bin2hex
(
$arg as xs:anyAtomicType
) as xs:string Converts a binary number to hexadecimal. |
|
|
bin2hex
(
$arg as xs:anyAtomicType,
$places as xs:anyAtomicType
) as xs:string Converts a binary number to hexadecimal. |
|
|
bin2oct
(
$arg as xs:anyAtomicType
) as xs:string Converts a binary number to octal. |
|
|
bin2oct
(
$arg as xs:anyAtomicType,
$places as xs:anyAtomicType
) as xs:string Converts a binary number to octal. |
|
|
dec2bin
(
$arg as xs:anyAtomicType
) as xs:string Converts a decimal number to binary. |
|
|
dec2bin
(
$arg as xs:anyAtomicType,
$places as xs:anyAtomicType
) as xs:string Converts a decimal number to binary. |
|
|
dec2hex
(
$arg as xs:anyAtomicType
) as xs:string Converts a decimal number to hexadecimal. |
|
|
dec2hex
(
$arg as xs:anyAtomicType,
$places as xs:anyAtomicType
) as xs:string Converts a decimal number to hexadecimal. |
|
|
dec2oct
(
$arg as xs:anyAtomicType
) as xs:string Converts a decimal number to octal. |
|
|
dec2oct
(
$arg as xs:anyAtomicType,
$places as xs:anyAtomicType
) as xs:string Converts a decimal number to octal. |
|
|
hex2bin
(
$arg as xs:anyAtomicType
) as xs:string Converts a hexadecimal number to binary. |
|
|
hex2bin
(
$arg as xs:anyAtomicType,
$places as xs:anyAtomicType
) as xs:string Converts a hexadecimal number to binary. |
|
|
hex2dec
(
$arg as xs:string
) as xs:integer Converts a hexadecimal number to decimal. |
|
|
hex2oct
(
$arg as xs:anyAtomicType
) as xs:string Converts a hexadecimal number to octal. |
|
|
hex2oct
(
$arg as xs:anyAtomicType,
$places as xs:anyAtomicType
) as xs:string Converts a hexadecimal number to octal. |
|
|
oct2bin
(
$arg as xs:anyAtomicType
) as xs:string Converts an octal number to binary. |
|
|
oct2bin
(
$arg as xs:anyAtomicType,
$places as xs:anyAtomicType
) as xs:string Converts an octal number to binary. |
|
|
oct2dec
(
$arg as xs:anyAtomicType
) as xs:integer Converts an octal number to decimal. |
|
|
oct2hex
(
$arg as xs:anyAtomicType
) as xs:string Converts an octal number to hexadecimal. |
|
|
oct2hex
(
$arg as xs:anyAtomicType,
$places as xs:anyAtomicType
) as xs:string Converts an octal number to hexadecimal. |
declare function excel-engineering:bin2dec (
$arg as xs:anyAtomicType
) as xs:integer
Converts a binary number to decimal.
- $arg the number.
- A decimal representation of a number given it's binary representation.
- excel-err:Value if provided value for $arg is not a binary representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
declare function excel-engineering:bin2hex (
$arg as xs:anyAtomicType
) as xs:string
Converts a binary number to hexadecimal.
- $arg the number.
- A hexadecimal representation of a number given it's binary representation.
- excel-err:Value if provided value for $arg is not a binary representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
declare function excel-engineering:bin2hex ( $arg as xs:anyAtomicType, $places as xs:anyAtomicType ) as xs:string
Converts a binary number to hexadecimal.
- $arg the number.
- $places is the number of characters to use. Places is useful for padding the return value with leading 0s (zeros).
- A hexadecimal representation of a number given it's binary representation.
- excel-err:Value if provided value for $arg is not a binary representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
- excel-err:Value if provided value for $places is not numeric.
- excel-err:Num if provided value for $places is zero or negative.
- excel-err:Num if provided value for $places is too small.
declare function excel-engineering:bin2oct (
$arg as xs:anyAtomicType
) as xs:string
Converts a binary number to octal.
- $arg the number.
- A octal representation of a number given it's binary representation.
- excel-err:Value if provided value for $arg is not a binary representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
declare function excel-engineering:bin2oct ( $arg as xs:anyAtomicType, $places as xs:anyAtomicType ) as xs:string
Converts a binary number to octal.
- $arg the number.
- $places is the number of characters to use. Places is useful for padding the return value with leading 0s (zeros).
- A octal representation of a number given it's binary representation.
- excel-err:Value if provided value for $arg is not a binary representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
- excel-err:Value if provided value for $places is not numeric.
- excel-err:Num if provided value for $places is zero or negative.
- excel-err:Num if provided value for $places is too small.
declare function excel-engineering:dec2bin (
$arg as xs:anyAtomicType
) as xs:string
Converts a decimal number to binary.
- $arg the number.
- A binary representation of a number given it's decimal representation.
- excel-err:Value if provided value for $arg is not numeric.
- excel-err:Num if provided value for $arg is smaller than -512 or bigger than 511.
declare function excel-engineering:dec2bin ( $arg as xs:anyAtomicType, $places as xs:anyAtomicType ) as xs:string
Converts a decimal number to binary.
- $arg the number.
- $places is the number of characters to use. Places is useful for padding the return value with leading 0s (zeros).
- A binary representation of a number given it's decimal representation.
- excel-err:Value if provided value for $arg is not numeric.
- excel-err:Value if provided value for $places is not numeric.
- excel-err:Num if provided value for $places is zero or negative.
- excel-err:Num if provided value for $places is too small.
- excel-err:Num if provided value for $arg is smaller than -512 or bigger than 511.
declare function excel-engineering:dec2hex (
$arg as xs:anyAtomicType
) as xs:string
Converts a decimal number to hexadecimal.
- $arg the number.
- A hexadecimal representation of a number given it's decimal representation.
- excel-err:Value if provided value for $arg is not numeric.
- excel-err:Num if provided value for $arg is smaller than -549755813888 or bigger than 549755813887
declare function excel-engineering:dec2hex ( $arg as xs:anyAtomicType, $places as xs:anyAtomicType ) as xs:string
Converts a decimal number to hexadecimal.
- $arg the number.
- $places is the number of characters to use. Places is useful for padding the return value with leading 0s (zeros).
- A hexadecimal representation of a number given it's decimal representation.
- excel-err:Value if provided value for $arg is not numeric.
- excel-err:Value if provided value for $places is not numeric.
- excel-err:Num if provided value for $places is zero or negative.
- excel-err:Num if provided value for $places is too small.
- excel-err:Num if provided value for $arg is smaller than -549755813888 or bigger than 549755813887.
declare function excel-engineering:dec2oct (
$arg as xs:anyAtomicType
) as xs:string
Converts a decimal number to octal.
- $arg the number.
- An octal representation of a number given it's decimal representation.
- excel-err:Value if provided value for $arg is not numeric.
- excel-err:Num if provided value for $arg is smaller than -536870912 or bigger than 536870911.
declare function excel-engineering:dec2oct ( $arg as xs:anyAtomicType, $places as xs:anyAtomicType ) as xs:string
Converts a decimal number to octal.
- $arg the number
- $places is the number of characters to use. Places is useful for padding the return value with leading 0s (zeros).
- An octal representation of a number given it's decimal representation.
- excel-err:Value if provided value for $arg is not numeric
- excel-err:Value if provided value for $places is not numeric
- excel-err:Num if provided value for $places is zero or negative
- excel-err:Num if provided value for $places is too small
- excel-err:Num if provided value for $arg is smaller than -536870912 or bigger than 536870911
declare function excel-engineering:hex2bin (
$arg as xs:anyAtomicType
) as xs:string
Converts a hexadecimal number to binary.
- $arg the number.
- A binary representation of a number given it's hexadecimal representation.
- excel-err:Value if provided value for $arg is not a hexadecimal representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
declare function excel-engineering:hex2bin ( $arg as xs:anyAtomicType, $places as xs:anyAtomicType ) as xs:string
Converts a hexadecimal number to binary.
- $arg the number.
- $places is the number of characters to use. Places is useful for padding the return value with leading 0s (zeros).
- A binary representation of a number given it's hexadecimal representation.
- excel-err:Value if provided value for $arg is not a hexadecimal representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
- excel-err:Value if provided value for $places is not numeric.
- excel-err:Num if provided value for $places is zero or negative.
- excel-err:Num if provided value for $places is too small.
declare function excel-engineering:hex2dec (
$arg as xs:string
) as xs:integer
Converts a hexadecimal number to decimal.
- $arg the number.
- A decimal representation of a number given it's hexadecimal representation.
- excel-err:Value if provided value for $arg is not a hexadecimal representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
declare function excel-engineering:hex2oct (
$arg as xs:anyAtomicType
) as xs:string
Converts a hexadecimal number to octal.
- $arg the number.
- A octal representation of a number given it's hexadecimal representation.
- excel-err:Value if provided value for $arg is not a hexadecimal representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
declare function excel-engineering:hex2oct ( $arg as xs:anyAtomicType, $places as xs:anyAtomicType ) as xs:string
Converts a hexadecimal number to octal.
- $arg the number.
- $places is the number of characters to use. Places is useful for padding the return value with leading 0s (zeros).
- A octal representation of a number given it's hexadecimal representation.
- excel-err:Value if provided value for $arg is not a hexadecimal representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
- excel-err:Value if provided value for $places is not numeric.
- excel-err:Num if provided value for $places is zero or negative.
- excel-err:Num if provided value for $places is too small.
declare function excel-engineering:oct2bin (
$arg as xs:anyAtomicType
) as xs:string
Converts an octal number to binary.
- $arg the number.
- A binary representation of a number given it's octal representation.
- excel-err:Value if provided value for $arg is not an octal representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
declare function excel-engineering:oct2bin ( $arg as xs:anyAtomicType, $places as xs:anyAtomicType ) as xs:string
Converts an octal number to binary.
- $arg the number.
- $places is the number of characters to use. Places is useful for padding the return value with leading 0s (zeros).
- A binary representation of a number given it's octal representation.
- excel-err:Value if provided value for $arg is not an octal representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
- excel-err:Value if provided value for $places is not numeric.
- excel-err:Num if provided value for $places is zero or negative.
- excel-err:Num if provided value for $places is too small.
declare function excel-engineering:oct2dec (
$arg as xs:anyAtomicType
) as xs:integer
Converts an octal number to decimal.
- $arg the number.
- A decimal representation of a number given it's octal representation.
- excel-err:Value if provided value for $arg is not an octal representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
declare function excel-engineering:oct2hex (
$arg as xs:anyAtomicType
) as xs:string
Converts an octal number to hexadecimal.
- $arg the number.
- A hexadecimal representation of a number given it's octal representation.
- excel-err:Value if provided value for $arg is not an octal representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
declare function excel-engineering:oct2hex ( $arg as xs:anyAtomicType, $places as xs:anyAtomicType ) as xs:string
Converts an octal number to hexadecimal.
- $arg the number.
- $places is the number of characters to use. Places is useful for padding the return value with leading 0s (zeros).
- A hexadecimal representation of a number given it's octal representation.
- excel-err:Value if provided value for $arg is not an octal representation of a number.
- excel-err:Value if provided value for $arg contains more than 10 characters.
- excel-err:Value if provided value for $places is not numeric.
- excel-err:Num if provided value for $places is zero or negative.
- excel-err:Num if provided value for $places is too small.