Treating Integers as Doubles for Certain Operations?

Правка en1, от minimario, 2017-12-31 21:36:40

Hello again :)

Recently I was solving problem with integers a[i] which involved two operations a[i] //= 2 and a[i] -= 1. And I read that it is equivalent that when we are performing these operations, to consider a[i] as a double, transforming a[i] //= 2 to a[i] / 2, and then at the end taking the floor.

This is a little obvious, but nevertheless very surprising to me. Can someone prove it?

Теги smile, sweet, service, surprise

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский minimario 2017-12-31 21:36:40 451 Initial revision (published)