This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2010-11-16 20:27:46

pannulaa1
Scratcher
Registered: 2010-10-16
Posts: 100+

Sig fig calculator

hi im this year im taking a introductery to chem course and i thought it might help if i made a scratch prodject to help us if we get stuck every things going good so far but i am not quite sure how to make a sig fig calculator Plz help me with any script you think can help me thanx
p.s. if you dont know what a sig fig is its a number thats significant all digits 1-9 are significant and 0s can be significant if there inbetween a whole number or last in a number with a decimal plz help thanx

Offline

 

#2 2010-11-16 20:38:15

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Sig fig calculator

Um... Your explanation was not clear. If you want a regular calculator, go here.

Offline

 

#3 2010-11-16 22:36:02

pannulaa1
Scratcher
Registered: 2010-10-16
Posts: 100+

Re: Sig fig calculator

kayybee wrote:

Um... Your explanation was not clear. If you want a regular calculator, go here.

Oh thanx  smile  but thats not wat i mean let me explain a little better i want to be able to calculate the number of sig figs in a number
im telling you this any number 1-9 is a sig fig fo so so in the number 9345 there are 4 sig figs becuz there are 4 numbers 1-9  0s are a bit harder there are three possibilities for zeros if theres a zero before a number the digit 0 is not significan 01 only has 1 sig fig becuz the 0 in front doesnt count
also ad the end of a number zeros dont count if there is no decimal 10 has only 1 sig fig but 10. has 2 sig figs becuz of the decimal and 1.0 has 2 sigfigs becuz of the decimal
place is there also if a zero is between a number  it counts 101 has three sig figs w/o the decimal point thats my def of sig figs i need to make a calculator for this
p.s decimal points do not add a sig fig they just help 0's become significant

Offline

 

#4 2010-11-16 22:48:34

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: Sig fig calculator

Hmm... Let's see... Here is a general plan you might follow. If you need any specific scripting, let me know.

1) Count number of non-zeros (Check each digit and see if it is a zero).
2) If there is a decimal place, start from the back add one for every zero until you get to a non-zero.
3) Starting from where you left of, go backwards and count the number of "sandwiched" zeros by going to each zero and seeing if the digits before and after it are either non-zeros, decimal places or zeros already determined to be significant. If the zero comes after the decimal place, check to see if there is a non-zero before the decimal place before counting it. Add this number to the total.


Sorry for the rambling. Does that make any sense? Does it help?

Last edited by scmb1 (2010-11-16 23:11:20)


http://i48.tinypic.com/2z5pqad.png

Offline

 

#5 2010-11-17 17:06:48

pannulaa1
Scratcher
Registered: 2010-10-16
Posts: 100+

Re: Sig fig calculator

scmb1 wrote:

Hmm... Let's see... Here is a general plan you might follow. If you need any specific scripting, let me know.

1) Count number of non-zeros (Check each digit and see if it is a zero).
2) If there is a decimal place, start from the back add one for every zero until you get to a non-zero.
3) Starting from where you left of, go backwards and count the number of "sandwiched" zeros by going to each zero and seeing if the digits before and after it are either non-zeros, decimal places or zeros already determined to be significant. If the zero comes after the decimal place, check to see if there is a non-zero before the decimal place before counting it. Add this number to the total.


Sorry for the rambling. Does that make any sense? Does it help?

there are scripts for that? P.s i see what you mean it makes sence

Offline

 

#6 2010-11-17 18:39:23

Ratty1967UK
Scratcher
Registered: 2007-05-16
Posts: 88

Re: Sig fig calculator

i'm not great with adding the scratch blocks to forum postings... haven't got the patience lol

I think what you're after is...

set sigfigs to round( log ( mynumber ) + 0.5 )

Offline

 

#7 2010-11-17 20:39:52

kayybee
Scratcher
Registered: 2009-12-07
Posts: 1000+

Re: Sig fig calculator

maybe i would be able to read it clearly if you didnt write like this can you read this easily with out my punctuation it really helps people read easier if you use punctuation thats what its for right

Offline

 

#8 2010-11-18 17:23:35

pannulaa1
Scratcher
Registered: 2010-10-16
Posts: 100+

Re: Sig fig calculator

kayybee wrote:

maybe i would be able to read it clearly if you didnt write like this can you read this easily with out my punctuation it really helps people read easier if you use punctuation thats what its for right

ok

Offline

 

#9 2010-11-21 10:01:18

scmb1
Scratch Team
Registered: 2009-03-19
Posts: 1000+

Re: Sig fig calculator

Ok, I made a project you can download and look at the scripts. I used a much simpler method than I described before, but I doubt it is the most efficient. See if you can make it better.


http://i48.tinypic.com/2z5pqad.png

Offline

 

Board footer