Time for an 2014 update…

This commit is contained in:
Ingy döt Net 2014-01-17 05:32:22 +00:00
parent 372c577f83
commit 09687c4926
2520 changed files with 34227 additions and 7318 deletions

View file

@ -1,21 +1,21 @@
import std.stdio, std.math;
void main() {
enum real degrees = 45.0;
enum real t0 = degrees * PI / 180.0;
import std.stdio, std.math;
enum degrees = 45.0L;
enum t0 = degrees * PI / 180.0L;
writeln("Reference: 0.7071067811865475244008");
writefln("Sine: %.20f %.20f", sin(PI_4), sin(t0));
writefln("Cosine: %.20f %.20f", cos(PI_4), cos(t0));
writefln("Tangent: %.20f %.20f", tan(PI_4), tan(t0));
writefln("Sine: %.20f %.20f", PI_4.sin, t0.sin);
writefln("Cosine: %.20f %.20f", PI_4.cos, t0.cos);
writefln("Tangent: %.20f %.20f", PI_4.tan, t0.tan);
writeln();
writeln;
writeln("Reference: 0.7853981633974483096156");
immutable real t1 = asin(sin(PI_4));
writefln("Arcsine: %.20f %.20f", t1, t1 * 180.0 / PI);
immutable real t1 = PI_4.sin.asin;
writefln("Arcsine: %.20f %.20f", t1, t1 * 180.0L / PI);
immutable real t2 = acos(cos(PI_4));
writefln("Arccosine: %.20f %.20f", t2, t2 * 180.0 / PI);
immutable real t2 = PI_4.cos.acos;
writefln("Arccosine: %.20f %.20f", t2, t2 * 180.0L / PI);
immutable real t3 = atan(tan(PI_4));
writefln("Arctangent: %.20f %.20f", t3, t3 * 180.0 / PI);
immutable real t3 = PI_4.tan.atan;
writefln("Arctangent: %.20f %.20f", t3, t3 * 180.0L / PI);
}