Opened 5 years ago

Closed 5 years ago

#2210 closed defect (fixed)

Fix type coercion rules

Reported by: Dimitar Misev Owned by: dkamov
Priority: major Milestone: 10.0
Component: catalogmgr Version: 9.8
Keywords: Cc: Peter Baumann, Vlad Merticariu
Complexity: Medium

Description (last modified by Dimitar Misev)

The following changes need to be implemented in source:catalogmgr/ops.cc in order to make the type coercion rules more consistent. It will require updating oracles in the systemtest as well.

+, -, *

Type coercion rules are now


Should be


div

  • Floating point operands should be supported
  • Type rules should be same as above for +, -, *

mod

  • Floating point operands should be supported (use std::remainder in code)
  • Type rules should be mostly like +, -, *, except that the result is f only if both operands are floating point


abs

  • Currently any operand results in a double
  • The result should have the same type as the operand

sqrt, log, ln, exp, pow, sin, cos, tan, sinh, cosh, tanh, arcsin, arccos, arctan

  • If both operands are f the result should be also float (now returns double in this case)

and, or, xor, not

  • Should work as boolean logic operators on inputs of any type, including floating-point (currently they work as bitwise operators if inputs are not boolean)

count_cells

  • Result type should be long instead of unsigned long

add_cells

  • For signed/unsigned integer input the result should be long

Attachments (3)

binary_plus_now.png (8.1 KB ) - added by Dimitar Misev 5 years ago.
binary_plus_todo.png (12.7 KB ) - added by Dimitar Misev 5 years ago.
mod_todo.png (7.4 KB ) - added by Dimitar Misev 5 years ago.

Download all attachments as: .zip

Change History (6)

by Dimitar Misev, 5 years ago

Attachment: binary_plus_now.png added

by Dimitar Misev, 5 years ago

Attachment: binary_plus_todo.png added

by Dimitar Misev, 5 years ago

Attachment: mod_todo.png added

comment:1 by Dimitar Misev, 5 years ago

Description: modified (diff)

comment:2 by Dimitar Misev, 5 years ago

The rules are now in place and documented at http://doc.rasdaman.org/04_ql-guide.html#type-coercion-rules

comment:3 by Dimitar Misev, 5 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.