Wednesday, January 25, 2006

A conversation I had with Michael today

Michael: in computers, what is 1*1.5?

sarah: 2

Michael: good guess

sarah: 1

Michael: it is typically 12
integer arith.

sarah: ah
i forgot about that

Michael: i just discovered a HUGE thing in VB that shocked me

sarah: so 1*1.9 is 1, too

Michael: yes

sarah: what's that?

Michael: CINT(1.9) is used to convert the argument to an integer
so, i would expect...
CINT(1.9) = 2
I would expect cint(1.9)=1

sarah: ya

Michael: it doesn't. Cint ROUNDS....holy shit

sarah: :)

Michael: i called bryan. he didn't believe me

sarah: crazy!

Michael: this is so backwards

sarah: you guys are nerdy

Michael: seriouslyt

sarah: i know!

Michael: it gets worse

sarah: it's so awesome!
and crazy!
crazily awesomely crazy!

Michael: it uses scientific rounding -- it rounds .5 to the nearest even!
cint(1.5) = 2
cint(2.5) = 2

sarah: omg no way!

Michael: so to go from assuming it simply truncated to now rounding ina very unusual way is very disconcerting
you think you are funny but you are not.