home *** CD-ROM | disk | FTP | other *** search
/ Australian Personal Computer 1999 April / APC443.iso / features / grpware / coldfus / coldfusi.exe / data1.cab / Documentation / snippets / log.cfm < prev    next >
Encoding:
Text File  |  1998-10-08  |  1.0 KB  |  31 lines

  1. <!--- This example shows how to use Log --->
  2. <HTML>
  3. <HEAD>
  4. <TITLE>
  5. Log Example
  6. </TITLE>
  7. </HEAD>
  8.  
  9. <BODY bgcolor=silver>
  10. <H3>Log Example</H3>
  11.  
  12. <CFIF IsDefined("form.number")>
  13. <CFOUTPUT>
  14. <P>Your number, #form.number#
  15. <BR>#form.number# raised to the E power: #exp("#form.number#")#
  16. <CFIF #form.number# LTE 0><BR>You must enter a positive real number to see the natural logarithm of that number<CFELSE><BR>The natural logarithm of #form.number#: #log("#form.number#")#</CFIF>
  17. <CFIF #form.number# LTE 0><BR>You must enter a positive real number to see the logarithm of that number to base 10<CFELSE><BR>The logarithm of #form.number# to base 10: #log10("#form.number#")#</CFIF>
  18. </CFOUTPUT>
  19. </CFIF>
  20.  
  21. <CFFORM ACTION="log.cfm" METHOD="POST">
  22. Enter a number to see its value raised to the E power,
  23. the natural logarithm of that number, and the logarithm of
  24. number to base 10.
  25. <CFINPUT TYPE="Text" NAME="number" MESSAGE="You must enter a number" VALIDATE="float" REQUIRED="No">
  26. <INPUT TYPE="Submit" NAME="">
  27. </CFFORM>
  28.  
  29. </BODY>
  30. </HTML>       
  31.