Examples: query, "exact match", wildcard*, wild?ard, wild*rd
Fuzzy search: cake~ (finds cakes, bake)
Term boost: "red velvet"^4, chocolate^2
Field grouping: tags:(+work -"fun-stuff")
Escape special characters +-&|!(){}[]^"~*?:\ - e.g. \+ \* \!
Range search: properties.timestamp:[1587729413488 TO *] (inclusive), properties.title:{A TO Z}(excluding A and Z)
Combinations: chocolate AND vanilla, chocolate OR vanilla, (chocolate OR vanilla) NOT "vanilla pudding"
Field search: properties.title:"The Title" AND text
Answered
Bitwise operation does not work as expected

I found a strange behavior in func bitwise operation. I don't understand why.

slice slice0 = begin_cell().store_coins(123).end_cell().begin_parse();

int result0 = 0 == 1;
~dump(result0); ;; this is 0

int result1 = equal_slices(slice0, slice0);
~dump(result1); ;; this is -1

~dump(result0 | result1); ;; this is -1, as expected

In above code, OR operation is working as expected. However, it does not in below code.

~dump(0 == 1); ;; this is 0
~dump(equal_slices(slice0, slice0)); ;; this is -1
~dump(0 == 1 | equal_slices(slice0, slice0)); ;; this is 0. Why?
  
  
Posted one year ago
Votes Newest

Answers 2


That hapepns because of the operation priorities. It executes | at first, and then ==. Add brackets to change it.

2
2
Posted one year ago
Daniil Sedov
233 × 6 Administrator

Thanks!

  
  
Posted one year ago
15K Views
2 Answers
one year ago
one year ago
Tags