33

CS Exam :
What is 3/2?
My answer : 1.5
Result : Wrong
Correct Answer : 1

Maths Exam :
What is 3/2?
My answer : 1
Result : Wrong
Correct Answer : 1.5

#Frustated (-_-)

Comments
  • 1
    Depends, maybe in whatever language that first one was in / is a modulo operator
  • 0
    @hidden Most languages i know if you divide ints you get ints not floats, it's a gotcha I got caught out a few times... Also it would depend what the variable type you are setting is
  • 1
    Integers cut off the decimal precision. It's a nice way to do a floor...it actually ends up being very convenient in a lot of situations. Learn the rules so you can abuse them! 😜
  • 0
    @Lisanna I'm currently doing that in my math class :p
Add Comment