Mercurial > projects > ldc
view test/intrinsics.d @ 295:895e1b50cf2a trunk
[svn r316] Fixed array slice assignments like: int[] arr = ...; arr[] = 42;
There was problems with most non basic types...
Added an option to premake so we can do: premake --target gnu --no-boehm
to disable the Boehm GC.
author | lindquist |
---|---|
date | Mon, 23 Jun 2008 14:48:42 +0200 |
parents | 44a95ac7368a |
children |
line wrap: on
line source
import llvm.intrinsic; extern(C) int printf(char*,...); extern(C) int scanf(char*,...); void main() { { float f; printf("Enter float: "); scanf("%f", &f); float sf = llvm_sqrt(f); printf("sqrt(%f) = %f\n", f, sf); } { double d; printf("Enter double: "); scanf("%lf", &d); double sd = llvm_sqrt(d); printf("sqrt(%lf) = %lf\n", d, sd); } { real d; printf("Enter real: "); scanf("%lf", &d); real sd = llvm_sqrt(d); printf("sqrt(%lf) = %lf\n", d, sd); } }