ScratchData LogoScratchData
Back to RedSGXD's profile

Factorial (My Approximation)

RERedSGXD•Created March 12, 2021
Factorial (My Approximation)
0
0
11 views
View on Scratch

Instructions

Enter a number (that's not negative) and it will approximate the factorial of n. https://www.desmos.com/calculator/yobpjxnqme Red is my new approximation (this one) Green is actual positive factorial Blue is my old approximation happe pi day :)

Description

My Factorial with negative numbers in Scratch is broken because it gives a number from 3 to the square root of pi because it uses even roots which for negative numbers give complex numbers (numbers that involve the imaginary number 'i') which is NaN in Scratch. Because 'NaN' is classified as 'text', Scratch treats it like 0, and does the equation like nothing is wrong. Note that for n>12, this approximation will be less than actual n! so if you intend on using this, just remember

Project Details

Project ID500422819
CreatedMarch 12, 2021
Last ModifiedMay 4, 2021
SharedMarch 14, 2021
Visibilityvisible
CommentsAllowed