Jump to content

Recommended Posts

Posted (edited)

Global $e = 1
Global $n = 0
While not @error
    $e = $e + 1/factorial($n)
    $n = $n + 1
WEnd
Msgbox ( 0, "hey", $e )

Func factorial($number)
    Local $n = 1
    
    For $i = 1 to $number
        $n = $n*$i
    Next
    
    If $n = 0 Then
        SetError ( 1 )
        Return -1
    Else
        Return $n
    EndIf
EndFunc

the example calculate the number e approximately.

Edited by Joke758

[u]My Programs:[/u]Word Search Creator - Make your own Word SearchShortHand - Hide a secret message in a jpg fileHex Editor - Edit your Binary fileIncrease file size - Increase the size of any filesArt Generator - A program that generate random picture[u]My Functions:[/u]16-Bits Hash - My Hash function similar to MD5Probabilities - My probabilities function (factorial, permuation, combination)_GetDate() - Convert a date to a day of the week_Base(), _Dec() - Convert a number in any base (bin, oct, hex, dec). Create your own!

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...