dev/vala/long_double/test128float.vala

25 lines
654 B
Vala
Raw Normal View History

2017-08-08 19:02:30 +03:00
void main () {
stdout.printf ("sizeof (double) = %lu\n", sizeof(double));
stdout.printf ("sizeof (Double128) = %lu\n", sizeof(Double128));
Double128 d1 = 16.0;
stdout.printf ("Double128: 16 ^ 2 = %f\n", d1 * d1);
double d = 1e-15;
stdout.printf ("double: d = %e, ", d);
d += 1; d -= 1;
stdout.printf ("(+-1) d = %e\n", d);
Double128 ld = 1e-19;
stdout.printf ("Double128: ld = %e, ", ld);
ld += 1; ld -= 1;
stdout.printf ("(+-1) ld = %e\n", ld);
2017-08-08 23:21:07 +03:00
ld = 1.234567;
stdout.printf ("ld = %e, ", ld);
d = ld; stdout.printf ("d = ld, ");
stdout.printf ("d = %e, ", d);
ld = d; stdout.printf ("ld = d, ");
stdout.printf ("ld = %e\n", ld);
2017-08-08 19:02:30 +03:00
}