Opened 5 years ago

Last modified 5 years ago

#2210 closed defect

Fix type coercion rules — at Version 1

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

Change History (4)

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)
Note: See TracTickets for help on using tickets.