GRASS Programmer's Manual  6.5.svn(2012)-r51648
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Defines
unfl.c
Go to the documentation of this file.
00001 /*  unfl.c    CCMATH mathematics library source code.
00002  *
00003  *  Copyright (C)  2000   Daniel A. Atkinson    All rights reserved.
00004  *  This code may be redistributed under the terms of the GNU library
00005  *  public license (LGPL). ( See the lgpl.license file for details.)
00006  * ------------------------------------------------------------------------
00007  */
00008 static unsigned int a=69069U,c=244045795U;
00009 static unsigned int s,h,sbuf[256];
00010 double unfl()
00011 { int i;
00012   i=(int)(s>>24); s=sbuf[i];
00013   h=a*h+c; sbuf[i]=h;
00014   return s*2.328306436538696e-10;
00015 }
00016 void setunfl(unsigned int k)
00017 { int j;
00018   for(h=k,j=0; j<=256 ;++j){
00019     h=a*h+c;
00020     if(j<256) sbuf[j]=h; else s=h;
00021    }
00022 }