Message Boards Message Boards

0
|
2323 Views
|
2 Replies
|
1 Total Likes
View groups...
Share
Share this post:

[?] Set a function with conditions?

Posted 6 years ago

The problem is : Use conditions to give a function pow[x,r]. Be sure to use the string "imaginary", and to test your result on pow[0,0], pow[2,0], pow[2,2], pow[-1,1/3], pow[-1,1/2], and pow[-1, [Pi]]. I'm unsure how to set it up to correctly for example, when I try pow[x, r] := "undefined" /; x = 0 && r = 0, it gives me 0 instead of undefined as the output

POSTED BY: Michelle Chen
2 Replies

Use == for testing if something is “equal”. A single equal is “Set”. You will need to quit your kernel because you assigned a value to x and r.

POSTED BY: Neil Singer
Posted 6 years ago

Thank you so much ! It worked after I used ==

POSTED BY: Michelle Chen
Reply to this discussion
Community posts can be styled and formatted using the Markdown syntax.
Reply Preview
Attachments
Remove
or Discard

Group Abstract Group Abstract