Just another update
This commit is contained in:
parent
a25938f123
commit
00a190b0a6
6591 changed files with 94363 additions and 23227 deletions
|
|
@ -1,6 +1,4 @@
|
|||
import std.stdio, std.algorithm, std.range;
|
||||
|
||||
double vdc(int n, in double base=2.0) pure nothrow {
|
||||
double vdc(int n, in double base=2.0) pure nothrow @safe @nogc {
|
||||
double vdc = 0.0, denom = 1.0;
|
||||
while (n) {
|
||||
denom *= base;
|
||||
|
|
@ -11,6 +9,8 @@ double vdc(int n, in double base=2.0) pure nothrow {
|
|||
}
|
||||
|
||||
void main() {
|
||||
foreach (b; 2 .. 6)
|
||||
writeln("\nBase ", b, ": ", iota(10).map!(n => vdc(n, b))());
|
||||
import std.stdio, std.algorithm, std.range;
|
||||
|
||||
foreach (immutable b; 2 .. 6)
|
||||
writeln("\nBase ", b, ": ", 10.iota.map!(n => vdc(n, b)));
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue