view trunk/aid/misc.d @ 7:b9fe92a2d8ad default tip

Removed old code.
author revcompgeek
date Tue, 06 May 2008 22:20:26 -0600
parents 810d58835f86
children
line wrap: on
line source

module aid.misc;

import std.random;
import std.stdio;

class InputException : Exception {
	this(char[] message){
		super(message);
	}
}

double rnd(){ // The function that should be included in every math library!
	return (cast(double)rand())/uint.max;
}

void printArray(double[] array){
	writef("[");
	for(int i=0; i<array.length-1; i++){
		writef("%f, ",array[i]);
	}
	writefln("%f]",array[$-1]);
}

void printArray(double[][] array){
	writef("[");
	for(int i=0; i<array.length; i++){
		printArray(array[i]);
	}
	writefln("]");
}

void printArray(double[][][] array){
	writef("[");
	for(int i=0; i<array.length; i++){
		printArray(array[i]);
	}
	writefln("]");
}