The purpose of this task is to explore working with   complex numbers.



Task

Given   n,   find the   nth   roots of unity.




#import std
#import nat
#import flo
 
roots = ~&htxPC+ c..mul:-0^*DlSiiDlStK9\iota c..mul@iiX+ c..cpow/-1.+ div/1.+ float
 
#cast %jLL
 
tests = roots* <1,2,3,4,5,6>