Team Ai
Datasetpublic

hschumann2/TempleOS-Source-Code

sourceHugging Faceupdated 1y agoView on Hugging Face
0likes847downloads
F64FileGen.txt28 linesDownload Raw Back to SortFileDemo
1 2//This makes a file of N random double values.3 4Cd(__DIR__);;5 6U0 F64FileGenTXT(U8 *filename,I64 n)7{8  I64 i;9  CDoc *doc=DocNew(filename);10  DocPrint(doc,"//This is unsorted.\n");11  for (i=0;i<n;i++)12    DocPrint(doc,"%12.6f\n",Rand);13  DocWrite(doc);14  DocDel(doc);15}16F64FileGenTXT("~/DemoUnsortedF64.DD.Z",10);17 18U0 F64FileGenDAT(U8 *filename,I64 n)19{//File/CFile, ::/Demo/Dsk/DataBase.HC20  I64 i;21  F64 *a=MAlloc(n*sizeof(F64));22  for (i=0;i<n;i++)23    a[i]=Rand;24  FileWrite(filename,a,n*sizeof(F64));25  Free(a);26}27F64FileGenDAT("~/DemoUnsortedF64.DATA.Z",10);28