The Artima Developer Community
Sponsored Link

Agile Buzz Forum
What's unexpected?

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
What's unexpected? Posted: Nov 25, 2003 10:41 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: What's unexpected?
Feed Title: David Buck - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/buck-rss.xml
Feed Description: Smalltalk can do that
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From David Buck - Blog

Advertisement
Here's a question I saw on a C# quiz:

Which mathematical operator can generate unexpected results when used with integer numbers?

a) Addition (+)
b) Decrement (--)
c) Modulus (%)
d) Division (/)
e) Multiplication (*)
The answer they want is d) because 10 / 3 produces 3 which some people find unexpected. For me, this is perfectly expected based on knowledge of integer arithmetic. I would tend to answer a), b), and e) because of integer overflow problems. The point is, it's only unexpected if you don't understand. What a strange question.

Read: What's unexpected?

Topic: Security issues everywhere Previous Topic   Next Topic Topic: BottomFeeder dev

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use