Determine Least Significant Digits
-
Hi Guys. I need to know how to determine the least significan't digits from a number. Now, I'm calculating a bunch of numbers and the total comes to say 17 digits in total. I need to only use ythe last significant 12 digits from the 13 digits. HOw do I determine what the least significant digits are? As an example: The calulated value is: 865807311427710 From this number I want to only obtain 807311427710. The problem I am having is that the calculated value can be any amount of digits long. Any help will be greatly appreciated. Thanks
Excellence is doing ordinary things extraordinarily well.
-
Hi Guys. I need to know how to determine the least significan't digits from a number. Now, I'm calculating a bunch of numbers and the total comes to say 17 digits in total. I need to only use ythe last significant 12 digits from the 13 digits. HOw do I determine what the least significant digits are? As an example: The calulated value is: 865807311427710 From this number I want to only obtain 807311427710. The problem I am having is that the calculated value can be any amount of digits long. Any help will be greatly appreciated. Thanks
Excellence is doing ordinary things extraordinarily well.
Brute force and ingnorance approach: Convert to a string, use substring to get the right hand end.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
-
Brute force and ingnorance approach: Convert to a string, use substring to get the right hand end.
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
-
Sounds easy enough but the problem is that I have no idea how long the string will be. It could be 20 digits, 30 digits, 15 digits or 12 digits. :sigh:
Excellence is doing ordinary things extraordinarily well.
So? Why would you care? number.ToString() doesn't care how long it is. string.Length tells you how long the other one is. You know how many digits you want to keep...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
-
Hi Guys. I need to know how to determine the least significan't digits from a number. Now, I'm calculating a bunch of numbers and the total comes to say 17 digits in total. I need to only use ythe last significant 12 digits from the 13 digits. HOw do I determine what the least significant digits are? As an example: The calulated value is: 865807311427710 From this number I want to only obtain 807311427710. The problem I am having is that the calculated value can be any amount of digits long. Any help will be greatly appreciated. Thanks
Excellence is doing ordinary things extraordinarily well.
-
So? Why would you care? number.ToString() doesn't care how long it is. string.Length tells you how long the other one is. You know how many digits you want to keep...
No trees were harmed in the sending of this message; however, a significant number of electrons were slightly inconvenienced. This message is made of fully recyclable Zeros and Ones "Rumour has it that if you play Microsoft CDs backwards you will hear Satanic messages.Worse still, is that if you play them forwards they will install Windows"
Aye, I got it. Below is what I have done.
FinalHash = homingTotal + OverFlow + ContraHash; string hashfinal = Convert.ToString(FinalHash); int length = hashfinal.Length; int remove = length - 12; outhash = hashfinal.Substring(remove, 12); finalhashtotal = Convert.ToInt64(outhash);
Excellence is doing ordinary things extraordinarily well.