ScratchData LogoScratchData
Back to _paperN1's profile

Bug in Random Number Function

_P_paperN1•Created July 7, 2015
Bug in Random Number Function
0
0
15 views
View on Scratch

Instructions

See inside.

Description

I found out about this as I was testing my sorting algorithm's speed (it is heapsort) and I found something with the random number function. Normally when both numbers of the low and high inputs in the random number function have no decimal point, the result is always an integer. But when you add something like 5.0 (not 5), the result is almost always a decimal. It turns out that when I input 5.0 into a variable and then send in the number using the variable, the result is not a decimal :( This problem only appears when all the digits after the decimal point in the value of the variable are only zeros, so I'll have to do a number with ending in .1 =( Let's see what we can do about it.

Project Details

Project ID69632032
CreatedJuly 7, 2015
Last ModifiedJuly 7, 2015
SharedJuly 7, 2015
Visibilityvisible
CommentsAllowed