You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Insertion ('!') and assignment ('=') are also supported:
a = decimal.new('1')
---
...
b = decimal.new('1e10')
---
...
c = decimal.new('1e-10')
---
...
d = box.tuple.new{5, a, 6, b, 7, c, "string"}
---
...
d
---
- [5, 1, 6, 10000000000, 7, 0.0000000001, 'string']
...
d:update{{'!', 3, dec.new('1234.5678')}}
---
- [5, 1, 1234.5678, 6, 10000000000, 7, 0.0000000001, 'string']
...
d:update{{'=', -1, dec.new('0.12345678910111213')}}
---
- [5, 1, 6, 10000000000, 7, 0.0000000001, 0.12345678910111213]
When performing an arithmetic operation ('+', '-'), where either the
updated field or the operand is decimal, the result will be decimal.
When both the updated field and the operand are decimal, the result
will, of course, be decimal.
...
This didn't involve significant change, since the description of update didn't exclude decimal. I merely mentioned that decimal was one example of a numeric field.
tuple:update and space:update now support deicmal operands for
arithmetic operations ('+' and '-'). The syntax is as usual:
Insertion ('!') and assignment ('=') are also supported:
Requested by @sergepetrenko in tarantool/tarantool@8317189.
The text was updated successfully, but these errors were encountered: