Fibonacci’s sexagesimals Leonardo da Pisano a.k.a Fibonacci was instrumental in bringing the Hindu-Arabic numeral system into Europe. Before that, mathematicians there worked in base sixty with Roman numerals.

For example, the square root of two might be approximated as: one and twenty-four parts of sixty and fifty-one parts of three-thousand-six-hundred, and written as: i xxiv li, with the scaling determined by context. At the time, “nothingness” was known (i.e. zero), but had no standard representation in this number system.

Had Fibonacci ignored these new-fangled decimal digits he encountered during his travels, he surely would have addressed the deficiencies in the current system. This improved system we'll call Fibonacci’s sexagesimals.

Your task is to write a program, function or code snippet which takes a floating point number in ASCII or binary format and outputs in base sixty Roman numerals. The input can be file, console, command line or function argument and output can be file or console, whichever is easiest.

The output can be upper or lower case, and must include these improvements:


use n or N to indicate null meaning a place has no value, i.e. “zero” (a problem with the system)
use e or E to indicate et corresponding to the sexagesimal point (another problem with the system)
use a middle dot · or an asterisk * to separate groups of Roman numerals (yet another problem with the system)


Assume the input will be floating point with mantissa not greater than lix·lix·lix·lix·lix. Fractions less than n·e·n·n·n·n·i can be ignored. So, provided the input has these restrictions, at most ten groups of Roman numerals with one e can be outputted.

Numbers less than i must have a leading n·e to ensure the context is clear.

Some examples: input → output


0 → n
1 → i
60 → i·n
0.1 → n·e·vi
3600 → i·n·n
10.5 → x·e·xxx
16777215 → i·xvii·xl·xx·xv
3.1415926536 → iii·e·viii·xxix·xliv·n·xlvii


The output must avoid unnecessary leading n· in the mantissa part, isolated e, or trailing ·n in the fractional part of the output. So for example, n·n·n·n·i, i·e, and i·e·n·n·n·n·n are incorrect outputs for an input of 1.

Differences of plus or minus n·e·n·n·n·n·i in the output are within tolerances and acceptable.

The input is any legal floating point in the language of your choice, so can include positive or negative exponents as long as the input doesn't fall outside the range specified above.

And finally, Roman numeral built-ins are allowed!
C – 584 bytes
Non-competing (obviously), but to serve as inspiration:
#include&lt;stdio.h&gt;
#include&lt;stdlib.h&gt;
#include&lt;math.h&gt;
char*f(int z){static char r[8];char*l[]={&quot;&quot;,&quot;I&quot;,&quot;II&quot;,&quot;III&quot;,&quot;IV&quot;,&quot;V&quot;,&quot;VI&quot;,&quot;VII&quot;,&quot;VIII&quot;,&quot;IX&quot;},*h[]={&quot;&quot;,&quot;X&quot;,&quot;XX&quot;,&quot;XXX&quot;,&quot;XL&quot;,&quot;L&quot;};if(!z)return&quot;N&quot;;sprintf(r,&quot;%s%s&quot;,h[z/10],l[z%10]);return r;}int main(int c,char**v){char*s=&quot;&quot;;int i,j,z[10],k=60;long x;double d,y;y=modf(atof(v[1]),&amp;d);x=d;for(i=4;i&gt;=0;i--){z[i]=x%k;x/=k;}for(i=5;i&lt;=9;i++){z[i]=(y*=k);y-=z[i];}for(i=0;!z[i]&amp;&amp;i&lt;4;i++);for(;i&lt;5;i++){printf(&quot;%s%s&quot;,s,f(z[i]));s=&quot;*&quot;;}for(j=9;!z[j]&amp;&amp;j&gt;=i;j--);if(i&lt;=j)printf(&quot;*E&quot;);for(;i&lt;=j;i++)printf(&quot;*%s&quot;,f(z[i]));printf(&quot;\n&quot;);return 0;}

Save as fs.c, build with gcc -o fs fs.c -lm, and run as ./fs &lt;arg&gt;.
Test cases:
$ ./fs 0
N
$ ./fs 1
I
$ ./fs 60
I*N
$ ./fs 0.1
N*E*VI
$ ./fs 3600
I*N*N
$ ./fs 10.5
X*E*XXX
$ ./fs 16777215
I*XVII*XL*XX*XV
$ ./fs 3.1415926536
III*E*VIII*XXIX*XLIV*N*XLVII

Largest mantissa and fraction:
$ ./fs 777599999
LIX*LIX*LIX*LIX*LIX
$ ./fs 0.999999998713992
N*E*LIX*LIX*LIX*LIX*LIX

I'm using double as the working type, so the largest mantissa and fraction combined exceeds the native accuracy of that type. If I used long double instead it could handle it.