YottaDB / YDB

Mirrored from https://gitlab.com/YottaDB/DB/YDB
Other
76 stars 37 forks source link

[#145] Ensure MV_INT bit is set if result of multiply or divide of two non-integer numeric quantities is 0 #148

Closed nars1 closed 6 years ago

nars1 commented 6 years ago

Not doing so could cause a later use of this result mval in a division operation to issue a fatal SIGINTDIV error (instead of a user-trappable DIVZERO error). This is because op_div.c and op_idiv.c assume that if the divisor has the MV_INT bit not set, it is a non-zero value.

The MV_INT bit set is achieved by checking explicitly if both the mantissa (m[0] and m[1]) are zero and if so setting the mval to "literal_zero".