otp.decimal#

class decimal(x=0, /)#

Bases: float

Object that represents decimal OneTick value. Decimal is 128 bit base 10 floating point number.

Examples

>>> t = otp.Ticks({'A': [otp.decimal(1), otp.decimal(2)]})
>>> t['B'] = otp.decimal(1.23456789)
>>> t['C'] = t['A'] / 0
>>> t['D'] = t['A'] + otp.nan
>>> otp.run(t)
                     Time    A         B    C    D
0 2003-12-01 00:00:00.000  1.0  1.234568  inf  NaN
1 2003-12-01 00:00:00.001  2.0  1.234568  inf  NaN