In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-22 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly explains "how to use the 36-bit addition of JavaScript". Interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn how to use the 36-bit addition of JavaScript.
Public class Test36Bin {
/ * 36 decimal equals 1 * 36 ^ 1 + 11 * 36 ^ 0 = 36 + 11 * require the sum of any two 36 positive integers to be calculated according to the addition rule * for example: the conversion of'1b'to decimal equals 1 * 36 ^ 1 + 11 * 36 ^ 0 = 36 + 11 = 47 * Calculate'1b'+ '2x' =' 48' * * requirement: it is not allowed to convert 36 digits into decimal digits as a whole, calculate the sum of decimal numbers and then convert them back to 36 digits * * @ param args * / public static void main (String [] args) {String result = addFunWithStr ("1b", "2x") System.out.println ("result =" + result);} / * * get the value * @ param ch * @ return * / public static int getIntFromChar (char ch) {int ret =-1; if (ch > ='0' & & ch ='a'& & ch = 0 & & j > = 0) {char ch_1 = param1.charAt (I) Char ch_2 = param2.charAt (j); int v1 = getIntFromChar (ch_1); int v2 = getIntFromChar (ch_2); int ret = v1 + v2; if (ret > = 36) {int index = ret-36 + temp; char sv = symbol.charAt (index) StringBuffer.append (sv); temp = 1; / / carry} else {int index = ret + temp; char sv = symbol.charAt (index); stringBuffer.append (sv); temp = 0 While (I > = 0) {char ch_1 = param1.charAt (I); stringBuffer.append (ch_1); iMurray- } while (j > = 0) {char ch_2 = param2.charAt (I); stringBuffer.append (ch_2); jmurmuri;} StringBuffer result = stringBuffer.reverse (); return result.toString ();}
}
At this point, I believe you have a deeper understanding of "how to use JavaScript's 36-ary addition". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.