Clarification on Lab Assignment 1

38 views
Skip to first unread message

Renjith Sebastian

unread,
Nov 1, 2017, 10:11:28 AM11/1/17
to 2017 Functional Programming TDA452 / DIT 142
Hi, 

Could someone please clarify whether we should consider negative values for n and k for the functions we define?

Thomas Hallgren

unread,
Nov 1, 2017, 11:13:37 AM11/1/17
to 2017 Functional Programming TDA452 / DIT 142
Hi,

The introduction to lab assignment 1 says: the power function takes two arguments n and k and computes nk. Your implementation only has to work for non-negative k.

Negative values for n should not be a problem, e.g. power (-3) 2 == 9.

So, in your testing, it is reasonable to include negative values for n, but only non-negative values for k.

Thomas Hallgren



On 11/1/17 3:11 PM, Renjith Sebastian wrote:
Hi, 

Could someone please clarify whether we should consider negative values for n and k for the functions we define?
--
You received this message because you are subscribed to the Google Groups "2017 Functional Programming TDA452 / DIT 142" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chalmers-fp-20...@googlegroups.com.
To post to this group, send email to chalmers...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/chalmers-fp-2017/489154e3-e77b-4e45-a661-a65f75aaf5cc%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Reply all
Reply to author
Forward
0 new messages