[XSL-LIST Mailing List Archive Home] [By Thread] [By Date] [Recent Entries] [Reply To This Message]

Re: exponential math functions in xslt

Subject: Re: exponential math functions in xslt
From: Dimitre Novatchev <dnovatchev@xxxxxxxxx>
Date: Thu, 19 Sep 2002 12:27:53 -0700 (PDT)
exponential calculations
--- "J.Pietschmann" <j3322ptm at yahoo dot de> wrote:
 
> Kuhn, Allen wrote:
> 
> > Does xslt have functions for doing exponential calculations?
> 
> I'm not aware of a built-in function (either in XPath
> or as an XSLT function). You can check the EXSLT math
> module, which is supported by many processors, check
> the list of extension functions your processor offers,
> check whether you can call it from the underlying
> system, or, if all else fails, get a book about numerical
> calculations and implement it yourself in XSLT. It's not
> all that hard unless you want to have high accuracy and/or
> high performance.
> 
> J.Pietschmann

The FXSL library has pure XSLT 1.0 implementations of the following
exp/log functions:

exp(), 

ln(), log10(), log2()

log(),

pow()

Therefore, it is not at all necessary to look for extension functions,
which will inevitably affect the portability of the application using
them.

As for another myth -- that extension functions are significantly
faster, I recently performed detailed timing in an XSLT application, in
which ln() was computed approx. 5000 times. Substitution of the FXSL
"ln" template with calls to a Javascript extension function led to less
than 10% increase of the speed. My decision, therefore, was not to use
the Javascript extension function, as the loss of portability was not
justified by the very minor increase in speed.

For more information see:

"An XSL Calculator: The Math Modules of FXSL",
 
http://fxsl.sourceforge.net/articles/xslCalculator/The%20FXSL%20Calculator.html#3._The_Exponential_and_Logarithmic_Functions




Hope this helped.

=====
Cheers,

Dimitre Novatchev.
http://fxsl.sourceforge.net/ -- the home of FXSL


__________________________________________________
Do you Yahoo!?
New DSL Internet Access from SBC & Yahoo!
http://sbc.yahoo.com

 XSL-List info and archive:  http://www.mulberrytech.com/xsl/xsl-list


Current Thread

PURCHASE STYLUS STUDIO ONLINE TODAY!

Purchasing Stylus Studio from our online shop is Easy, Secure and Value Priced!

Buy Stylus Studio Now

Download The World's Best XML IDE!

Accelerate XML development with our award-winning XML IDE - Download a free trial today!

Don't miss another message! Subscribe to this list today.
Email
First Name
Last Name
Company
Subscribe in XML format
RSS 2.0
Atom 0.3
Site Map | Privacy Policy | Terms of Use | Trademarks
Free Stylus Studio XML Training:
W3C Member
Stylus Studio® and DataDirect XQuery ™are products from DataDirect Technologies, is a registered trademark of Progress Software Corporation, in the U.S. and other countries. © 2004-2013 All Rights Reserved.