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
kayybee wrote:
Um... Your explanation was not clear. If you want a regular calculator, go here.
Oh thanx 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
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)
Offline
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
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
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