Category:Nickle: Difference between revisions

Tweak sampler for Nickle intro
(Update some details for Nickle)
(Tweak sampler for Nickle intro)
 
Line 28:
printf("%s\n", to_json(p));
 
/* digits, %v spec for any "poly" types */
/* Digits */
printf("%g\n", 1/3);
printf("%dg\n", 10**50imprecise(1/3, 8)); /* 8 bit internal precision */
printf("%v\n", imprecise(1/3, 32)); /* 32 bit precision */
printf("%v\n", imprecise(1/3, 500)); /* 500 bit precision */
int f = 50!;
print f;
 
/* looping */
for (int i = 0; i < dim(dp); i++) {
printf("%dv ", dp[i]);
}
printf("\n");</lang>
Line 51 ⟶ 55:
]
0.333333333333333
0.33
100000000000000000000000000000000000000000000000000
0.333333333
1 2 3</pre>
0.333333333333333
global int f = 30414093201713378043612608166064768844377641568960512000000000000;
1 2"abc" 342</pre>
 
SuitableWhile ofvery suitable for general purpose programming, Nickle excels at prototyping numeric algorithms, and can be a nice complement to tools like Perl and AWK.
Anonymous user