⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 bc.1

📁 UNIX版本6的源代码
💻 1
字号:
.th BC I 2/20/75.sh NAMEbc \*- arbitrary precision interactive language.sh SYNOPSIS.bd bc[.bd \-l] [ file ... ].sh DESCRIPTION.it Bcis an interactive processor for a language which resemblesC but provides unlimited precision arithmetic.It takes input from any files given, then readsthe standard input.The `\-l' argument stands for the nameof a library of mathematical subroutineswhich contains sine (named `s'), cosine (`c'),arctangent (`a'), natural logarithm (`l'),and exponential (`e').The syntax for .it bcprograms is as follows;E means expression, S means statement..s3.lp +6 6Comments.brare enclosed in /* and */..s3.lp +6 6Names.brletters a\-z.brarray elements: letter[E].brThe words `ibase', `obase', and `scale'.s3.lp +6 6Other operands.brarbitrarily long numbers with optional sign and decimal point..br( E ).brsqrt ( E ).br<letter> ( E , ... , E ).s3.lp +6 6Operators.br+  \-  *  /  %  ^.br++   \-\-         (prefix and postfix; apply to names).br==  <=  >=  !=  <  >.br=  =+  =\-  =*  =/  =%  =^.br.s3.lp +6 6Statements.brE.br{ S ; ... ; S }.brif ( E ) S.brwhile ( E ) S.brfor ( E ; E ; E ) S.brnull statement.brbreak.brquit.s3.lp +6 6Function definitions are exemplified by.brdefine <letter> ( <letter> ,..., <letter> ) {.br	auto <letter>, ... , <letter>.br	S; ... S.br	return ( E ).br}.s3.i0.dtAll function arguments are passed by value..s3The value of a statement that is an expression is printedunless the main operator is an assignment.Either semicolons or newlines may separate statements.Assignment to.it scaleinfluences the number of digits to be retained on arithmeticoperations.Assignments to.it ibaseor.it obaseset the input and output number radix respectively..s3The same letter may be used as an array name, a function name,and a simple variable simultaneously.`Auto' variables are saved and restored during function calls.All other variables are global to the program.When using arrays as function argumentsor defining them as automatic variablesempty square brackets must follow the array name..s3For example.s3.nfscale = 20define e(x){	auto a, b, c, i, s	a = 1	b = 1	s = 1	for(i=1; 1==1; i++){		a = a*x		b = b*i		c = a/b		if(c == 0) return(s)		s = s+c	}}.s3.fidefines a function to compute an approximate value ofthe exponential function and.s3.nf	for(i=1; i<=10; i++) e(i).fi.s3prints approximate values of the exponential function ofthe first ten integers..sh FILES/usr/lib/lib.b	mathematical library.sh "SEE ALSO".it dc(I),C Reference Manual,``BC \- An Arbitrary Precision Desk-Calculator Language.''.sh BUGSNo &&, | | yet..br.it forstatement must have all three E's.br.it quitis interpreted when read, not when executed.

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -