Inline::BC

Inline::BC contains an inline ILSM for bc the arbitrary precision math Language.
Download

Inline::BC Ranking & Summary

Advertisement

  • Rating:
  • License:
  • Perl Artistic License
  • Price:
  • FREE
  • Publisher Name:
  • Piers Harding
  • Publisher web site:
  • http://search.cpan.org/~piers/sapnwrfc-0.17/sapnwrfc.pm

Inline::BC Tags


Inline::BC Description

Inline::BC contains an inline ILSM for bc the arbitrary precision math Language. SYNOPSIS use Inline BC; print x(int(rand(time()))); __DATA__ __BC__ define x(a){ scale = 20; return (a*3.456789); }Inline::BC is an ILSM (Inline Support Language Module ) for Gnu bc, the arbitrary precision numeric processing language. Inline::BC - like other ILSMs - allows you compile (well - render to byte code ), and run Gnu bc code within your Perl program.From the Gnu BC README:bc is an arbitrary precision numeric processing language. Syntax is similar to C, but differs in many substantial areas. It supports interactive execution of statements. bc is a utility included in the POSIX P1003.2/D11 draft standard.This version was written to be a POSIX compliant bc processor with several extensions to the draft standard. Option flags are available to cause warning or rejection of the extensions to the POSIX standard. For those who want only POSIX bc with no extensions, a grammar is provided for exactly the language described in the POSIX document. The grammar (sbc.y) comes from the POSIX document. The Makefile contains rules to make sbc. (for Standard BC)"end of quote"Further documentation about Gnu bc can be found at:http://www.gnu.org/software/bc/bc.html http://www.gnu.org/manual/bc/html_mono/bc.htmlone thing to note is that you should be careful with setting the global bc parameters like ibase, obase, scale etc. You should not set these in the global code - instead, set them in each function, to avoid the chaos that would follow.Looking at the test suite - there are examples of several different ways of invoking Inline::BC:(1) code in the DATA statement use Inline BC; print x(4) == 5.3 ? "ok 2n" : "not ok 2n"; __DATA__ __BC__ define x (a) { scale = 20 return (a * 1.5); }(2) inline code with here document use Inline BC => './tools/test.dat'; print aa() =~ //s ? "ok 4n" : "not ok 4n"; Requirements: · Perl


Inline::BC Related Software