This is indB.c in view mode; [Download] [Up]
#include <stdio.h> #include <math.h> main(int argc, char* argv[]) { double v,k; if(argc > 1) { if( argv[1][0] = '-' && argv[1][1] == 'p' ) k = 10; else { fprintf(stderr,"Invalid argument.\n"); exit(-1); } } else k = 20; while( scanf("%lf", &v) > 0 ) if( v>0 ) printf("%g\n", k*log10(v) ); else printf("%g\n", -300. ); }
These are the contents of the former NiCE NeXT User Group NeXTSTEP/OpenStep software archive, currently hosted by Netfuture.ch.