view test/intrinsics.d @ 32:a86fe7496b58 trunk

[svn r36] * Fixed a bug where passing a regular argument to a ref argument did not allocate storage
author lindquist
date Thu, 04 Oct 2007 18:24:05 +0200
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);
    }
}