File:  [LON-CAPA] / loncom / homework / default_homework.lcpm
Revision 1.1: download - view: text, annotated - select for diffs
Tue Sep 26 19:29:07 2000 UTC (23 years, 7 months ago) by harris41
Branches: MAIN
CVS tags: HEAD
adding a file suffix extension (lcpm=loncapa perl module; invented by Mr. Guy, submitted to CVS in the year 2000... wow, it's historic) -Scott

    1: # file name (temp): default_homework 
    2: # used by lonxml::xmlparse() as input variable $safeinit to Apache::run::run()
    3: # 
    4: #
    5: sub hinton {
    6:   return 0;
    7: }
    8: 
    9: sub random {
   10:   my ($start,$end,$step)=@_;
   11:   my $num=1+int(($end-$start)/$step);
   12:   my $result=$start + int(rand() * $num)*$step;
   13:   return $result;
   14: }
   15: 
   16: sub tan  { sin($_[0]) / cos($_[0]) }
   17: sub acos { atan2(sqrt(1 - $_[0] * $_[0]), $_[0] ); }
   18: sub asin { atan2($_[0], sqrt(1- $_[0] * $_[0]) );  }
   19: 
   20: sub html {
   21:   if ( $external::target == "web" ) {
   22:     $Apache::scripttag::start_script::result.=@_[0];
   23:   }
   24: }
   25: 
   26: 
   27: sub pow   {return $_[0] ** $_[1]; }
   28: sub ceil  {return (($_[0]-int($_[0]))== 0.0) ? $_[0] : (int($_[0])+ 1); }
   29: sub floor {return int($_[0]);  }
   30: 
   31: 

FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>