table of contents
other versions
- jessie 1:17.3-dfsg-4+deb8u2
- jessie-backports 1:19.2.1+dfsg-2+deb9u1~bpo8+1
- stretch 1:19.2.1+dfsg-2+deb9u2
fixed(3erl) | Erlang Module Definition | fixed(3erl) |
NAME¶
fixed - the corba fixed typeDESCRIPTION¶
This module contains functions that gives an interface to the CORBA fixed type. The type Fixed used below is defined as:-record(fixed, {digits, scale, value}).where digits is the total amount of digits it consists of and scale is the number of fractional digits. The value field contains the actual Fixed value represented as an integer. The limitations of each field are:
- *
- Digits - integer(), -1 > Digits < 32
- *
- Scale - integer(), -1 > Scale =< Digits
- *
- Value - integer(), range (31 digits): +/-9999999999999999999999999999999
- *
- fixed<5,3> eq. 03.140d eq. 3140
- *
- fixed<3,2> eq. 3.14d eq. 314
- *
- Fixed1 + Fixed2 - fixed<max(d1-s1,d2-s2) + max(s1,s2) + 1, max(s1,s2)>
- *
- Fixed1 - Fixed2 - fixed<max(d1-s1,d2-s2) + max(s1,s2) + 1, max(s1,s2)>
- *
- Fixed1 * Fixed2 - fixed<d1+d2, s1+s2>
- *
- Fixed1 / Fixed2 - fixed<(d1-s1+s2) + Sinf ,Sinf >
EXPORTS¶
create(Digits, Scale, Value) -> Result
Types:
Result = Fixed Type | {'EXCEPTION', #'BAD_PARAM'{}}
This function creates a new instance of a Fixed Type. If the limitations
is not fulfilled (e.g. overflow) an exception is raised.
get_typecode(Fixed) -> Result
Types:
Result = TypeCode | {'EXCEPTION', #'BAD_PARAM'{}}
Returns the TypeCode which represents the supplied Fixed type. If the parameter
is not of the correct type, an exception is raised.
add(Fixed1, Fixed2) -> Result
Types:
Result = Fixed1 + Fixed2 | {'EXCEPTION', #'BAD_PARAM'{}}
Performs a Fixed type addition. If the parameters are not of the correct type,
an exception is raised.
subtract(Fixed1, Fixed2) -> Result
Types:
Result = Fixed1 - Fixed2 | {'EXCEPTION', #'BAD_PARAM'{}}
Performs a Fixed type subtraction. If the parameters are not of the correct
type, an exception is raised.
multiply(Fixed1, Fixed2) -> Result
Types:
Result = Fixed1 * Fixed2 | {'EXCEPTION', #'BAD_PARAM'{}}
Performs a Fixed type multiplication. If the parameters are not of the correct
type, an exception is raised.
divide(Fixed1, Fixed2) -> Result
Types:
Result = Fixed1 / Fixed2 | {'EXCEPTION', #'BAD_PARAM'{}}
Performs a Fixed type division. If the parameters are not of the correct type,
an exception is raised.
unary_minus(Fixed) -> Result
Types:
Result = -Fixed | {'EXCEPTION', #'BAD_PARAM'{}}
Negates the supplied Fixed type. If the parameter is not of the correct type, an
exception is raised.
orber 3.8.2 | Ericsson AB |