Mercurial > projects > ldc
view test/intrinsics.d @ 85:f869c636a113 trunk
[svn r89] Fixed a bunch of problems with template instance across multiple modules.
Fixed initialization of function local static variables, with a non const initializer (now happens on first call using a global to make sure it only happens once.)
author | lindquist |
---|---|
date | Fri, 02 Nov 2007 06:32:32 +0100 |
parents | c53b6e3fe49a |
children | 44a95ac7368a |
line wrap: on
line source
import llvm.intrinsic; 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); } }