Search Results
Search type | Search syntax |
---|---|
Tags | [tag] |
Exact | "words here" |
Author |
user:1234 user:me (yours) |
Score |
score:3 (3+) score:0 (none) |
Answers |
answers:3 (3+) answers:0 (none) isaccepted:yes hasaccepted:no inquestion:1234 |
Views | views:250 |
Code | code:"if (foo != bar)" |
Sections |
title:apples body:"apples oranges" |
URL | url:"*.example.com" |
Saves | in:saves |
Status |
closed:yes duplicate:no migrated:no wiki:no |
Types |
is:question is:answer |
Exclude |
-[tag] -apples |
For more details on advanced search visit our help page |
The challenge involves mathematics in some central way. Also consider using more specific tags, listed in the tag wiki info.
2
votes
Find i^n, given n
Haskell GHCi, 29 Bytes - 15 = 14
i p=[cos(p*pi/2),sin(p*pi/2)]
Usage:
*Main> i 0
[1.0,0.0]
*Main> i pi
[0.22058404074969779,-0.9753679720836315]
*Main> i (-6.4)
[-0.8090169943749477,0.587785252292 …
2
votes
Wait, but what's e^N?
Haskell 30 raw, 15 with bonus:
e a b=map(*exp a)[cos b,sin b]
load it up into the GHCi, then try out the function:
Ok, modules loaded: Main.
*Main> e 3 0
[20.085536923187668,0.0]
*Main> e 0 (-2)
[ …