Call a function in a shared library: Difference between revisions

adding lambdatalk
m (ABI)
(adding lambdatalk)
Line 1,326:
> cfloor( 2.3 );
2.</syntaxhighlight>
 
=={{header|Lambdatalk}}==
 
Lambdatalk works in a wiki, lambdatank, hosted by any web browser coming with Javascript. Javascript has no native tools dealing with big numbers. Jonas Raoni Soares Silva has built a smart JS library, http://jsfromhell.com/classes/bignumber, which can be loaded in a wiki page, so called "lib_BN". Obviously interfaces must be built, for instance the BN.* operator multiplying two big numbers:.
 
<syntaxhighlight lang="scheme">
{script
LAMBDATALK.DICT['BN.*'] = function(){
var args = arguments[0].split(' '),
a = new BigNumber( args[0], BN_DEC ),
b = new BigNumber( args[1], BN_DEC );
return a.multiply( b )
};
</syntaxhighlight>
 
The lib_BN library can be loaded in any other wiki page via a {require lib_BN} expression and the BN.* primitive can be used this way:
 
<syntaxhighlight lang="scheme">
{BN.* 123456789123456789123456789 123456789123456789123456789}
-> 15241578780673678546105778281054720515622620750190521
 
to be compared with the "standard" lambdatalk builtin * operator
 
{* 123456789123456789123456789 123456789123456789123456789}
-> 1.524157878067368e+52
</syntaxhighlight>
 
=={{header|Mathematica}}/{{header|Wolfram Language}}==
This works on windows and on linux/mac too (through Mono)
99

edits