6.170 Forum
August 16, 2006, 04:51:18 PM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News: Welcome to the 6.170 Forum.
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: strictfp part of spec?  (Read 247 times)
Advay Mengle
Full Member
***
Posts: 50


View Profile
« on: April 02, 2006, 09:03:28 PM »

Is adding the "strictfp" modifier to a class a modification to the class's spec?

I ask because we are told to add strictfp to any class that may perform floating point arithmetic, but that includes some of the "fully specified" classes in PS2 (like GeoSegment or WalkingRouteFormatter) whose specs we are told to leave unchanged.

Also, I assume we are not allowed to add strictfp to the classes provided in PS6 (Address, InvalidDatabaseException, InvalidAddressException, and NoPathException classes and the Directions interface) since those are not to be modified at all?  (Those shouldn't really need strictfp anyway).
Logged

-- Advay Mengle, '09
Michael Ernst
6.170 Staff
Full Member
*****
Posts: 46


View Profile Email
« Reply #1 on: April 03, 2006, 08:43:11 AM »

Because our tests are, for the most part, designed to allow approximate answers, we believe that adding the strictfp modifier to the classes will not affect your results.  However, we have not tested this for all cases.

You may add this modifier, but do avoid it wherever it isn't strictly necessary.
Logged
Advay Mengle
Full Member
***
Posts: 50


View Profile
« Reply #2 on: April 03, 2006, 03:20:26 PM »

Now I'm confused - in order to pass the staff provided tests, are we better off with "strictfp" or without it?

And what if some students' tests use strictfp, while others don't?

Thanks
« Last Edit: April 03, 2006, 03:22:03 PM by Advay Mengle » Logged

-- Advay Mengle, '09
Advay Mengle
Full Member
***
Posts: 50


View Profile
« Reply #3 on: April 04, 2006, 01:18:36 AM »

Sorry for double posting, but this is kind of important.

Should we or should we not use "strictfp" in order to pass the staff tests?
Logged

-- Advay Mengle, '09
Michael Ernst
6.170 Staff
Full Member
*****
Posts: 46


View Profile Email
« Reply #4 on: April 04, 2006, 01:56:56 PM »

The problem set clearly states that you should use strictfp:  http://web.mit.edu/6.170/www/psets/ps6/ps6.html#Miscellaneous

We have designed our tests in such a way that we hope this is not necessary -- in other words, we are making an effort not to penalize those who forget to use strictfp.  However, we cannot guarantee this, so we recommend the use of strictfp.
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1 RC2 | SMF © 2001-2005, Lewis Media Valid XHTML 1.0! Valid CSS!