Mercurial > projects > ldc
view test/intrinsics.d @ 109:5ab8e92611f9 trunk
[svn r113] Added initial support for associative arrays (AAs).
Fixed some problems with the string runtime support functions.
Fixed initialization of array of structs.
Fixed slice assignment where LHS is slice but RHS is dynamic array.
Fixed problems with result of assignment expressions.
Fixed foreach problems with key type mismatches.
author | lindquist |
---|---|
date | Wed, 21 Nov 2007 04:13:15 +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); } }