Message Boards Message Boards

GROUPS:

[✓] Set a function with conditions?

Posted 6 months ago
574 Views
|
2 Replies
|
1 Total Likes
|

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

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 6 months ago

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

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