Skip to main content
Known Participant
April 3, 2009
Question

Deprecated math operator ^ ?

  • April 3, 2009
  • 2 replies
  • 659 views
I was using Cold Fusion MX7, and now I'm on CF8.

This week someone told me that I had a problem with one of my calculation, it use to be giving the good result but now it is not giving good result. The only thing I can see is that the math operator ^ is deprecated in CF8, is there something that replace it???
    This topic has been closed for replies.

    2 replies

    Known Participant
    April 3, 2009
    Hi Adam,

    I did not meant to say that the ^ was depreciated, what I should've wrote is "is the math operator ^ is deprecated in CF8?" I'm french so my english is sometime off a bit :-)

    Inspiring
    April 8, 2009

    Sorry, I did reply to this on 4/4/2009, but the response seems to have gone AWOl during the upghrade of the forums.

    Here's what I said:

    > Hi Adam,
    >
    > I did not meant to say that the ^ was depreciated, what I should've wrote is "is the math operator ^ is deprecated in CF8?" I'm french so my english is sometime off a bit :-)

    Ah right.  Well your English is at least as good as a lot of native English
    speakers I know, so don't apologise for that.

    So, to answer your question: no, the ^ operator is not deprecated.

    Back to my other question:
    >> What kind of differences in results are you seeing?

    IE: what's an exact of a difference in the result on CFMX7 compared to CF8? 
    Can you provide some example values I can try in my own environment?

    --
    Adam

    Inspiring
    April 3, 2009
    > the math operator ^ is deprecated in CF8,

    Cite?

    It certainly doesn't say anything like that in the docs:
    http://livedocs.adobe.com/coldfusion/8/htmldocs/Expressions_03.html

    {quote}
    ^

    Exponentiation: Return the result of a number raised to a power (exponent).
    Use the caret character (^) to separate the number from the power; for
    example, 2^3 is 8. Real and negative numbers are allowed for both the base
    and the exponent. However, any expression that equates to an imaginary
    number, such -1^.5 results in the string "-1.#IND. ColdFusion does not
    support imaginary or complex numbers.
    {quote}

    But anyway, if something is deprecated, it still works same as it ever did,
    it's simply flagged for obsolescence. So even if the ^ operator was
    deprecated, there'd be no difference in how it worked before and after
    deprecation.

    CF seldom deprecates things, and even when deprecated, things are seldom
    actually obsoleted. A good example is the parameterExists() function: it's
    be deprecated since (at least) CF5. It's still there and functional in CF8
    though.


    > <cfset mtp = #rem# * 100 * ( (1 - ((1+ (#tme#/100))^-#duree#) ) ) / #tme#>

    Well you don't need those pound signs in there, but having them just makes
    your code look untidy, it doesn't actually impact anything.

    What kind of differences in results are you seeing?

    --
    Adam