កម្មវិធី​បម្លែង​មូលដ្ឋាន​លេខ

បម្លែង​លេខ​រវាង​ប្រព័ន្ធ​គោល​ពីរ ប្រព័ន្ធ​ប្រាំមួយ ប្រព័ន្ធ​ដប់ និង​ប្រព័ន្ធ​ដប់ប្រាំមួយ ។

លទ្ធផល —
ការ​បម្លែង —

លទ្ធផល​ធ្វើ​ឲ្យ​ទាន់សម័យ​តាម​ដែល​អ្នក​វាយ ។

តើ​ម៉ាស៊ីន​គិតលេខ​នេះ​បាន​ផ្ដល់​ចម្លើយ​ត្រឹមត្រូវ​ដល់​អ្នក​ឬ ?

អំពី​ម៉ាស៊ីន​គិតលេខ​នេះ

A number base converter rewrites an integer from one positional base to another — binary (base 2), octal (base 8), decimal (base 10) and hexadecimal (base 16). It reads your value in the source base, works out its plain decimal value, and re-expresses that value in the target base.

Each base uses a fixed set of digits: 0–1 for binary, 0–7 for octal, 0–9 for decimal and 0–9 then A–F for hexadecimal, where A–F stand for 10–15. Because 16 is 2⁴, each hex digit maps to exactly four binary digits, which is why programmers use hex as shorthand for raw bytes.

Worked example: the decimal number 255 is 11111111 in binary and FF in hexadecimal, since 255 = 15×16 + 15. The converter also reports the intermediate decimal value so you can check the working. A results table shows the same number in all four bases at once, and an invalid digit for the chosen source base is flagged rather than silently miscounted.

សំណួរ​ដែល​សួរ​ញឹកញាប់

តើ​ខ្ញុំ​បម្លែង​ទសភាគ​ទៅ​គោលពីរ​ដោយ​របៀប​ណា ?

Repeatedly divide by 2 and read the remainders from bottom to top. For example 10 in decimal is 1010 in binary, and 255 is 11111111.

តើ​អ្វី​ជា​ប្រព័ន្ធ​គោល​ដប់​ប្រាំមួយ​ដែល​បាន​ប្រើ​សម្រាប់ ?

Hexadecimal (មូលដ្ឋាន 16) វេចខ្ចប់បំណែក binary ចំនួនបួនចូលទៅក្នុងតួលេខមួយ (0-9 បន្ទាប់មក A-F), ដូច្នេះវាជាវិធីសាមញ្ញដើម្បីសរសេរបៃ. ចំនួនទសភាគ 255 គឺ FF ក្នុង hex.

ហេតុ​អ្វី​បាន​ជា​លេខ​របស់​ខ្ញុំ​បង្ហាញ​សញ្ញា​ក្បៀស ?

តួលេខ​ត្រូវ​តែ​ត្រឹមត្រូវ​សម្រាប់​មូលដ្ឋាន​ប្រភព​ ឧទាហរណ៍​តែ​0និង 1 ក្នុង​ប្រព័ន្ធ​គោល​ពីរ ឬ 0-9និង A-F ក្នុង​ប្រព័ន្ធ​គោល​ប្រាំមួយ ។ តួលេខ​មិន​ត្រឹមត្រូវ​ធ្វើ​ឲ្យ​លទ្ធផល​មិន​បាន​កំណត់ ។

តើ​តួអក្សរ A ទៅ F មាន​ន័យ​យ៉ាង​ដូចម្តេច​ក្នុង​ប្រព័ន្ធ​គោល​ដប់​ប្រាំមួយ ?

ពួកគេ​ជា​តួលេខ​តែ​មួយ​សម្រាប់​តម្លៃ​ 10 តាមរយៈ 15: A គឺ 10, B គឺ 11, រហូតដល់ F ដែល​គឺ 15. នេះ​អនុញ្ញាត​ឲ្យ​មូលដ្ឋាន 16 សមលេខ​រហូតដល់ 15 ទៅ​ក្នុង​កន្លែង​មួយ​មុន​ពេល​វា​ត្រូវ​បាន​ដឹក​ជញ្ជូន ។

ហេតុ​អ្វី​បាន​ជា​តួ​លេខ​គោល​ដប់​ប្រាំ​មួយ​នីមួយៗ​ស្មើ​នឹង​តួ​លេខ​គោល​ពីរ​បួន ?

Because 16 equals 2 to the fourth power, every hexadecimal digit covers exactly four bits. So the byte 11111111 groups into 1111 1111, which is FF — this number base converter does that grouping for you.

តើ​កម្មវិធី​បម្លែង​នេះ​អាច​ដោះស្រាយ​ចំនួន​ធំ​បាន​ឬ ?

វា​ធ្វើការ​លើ​ចំនួន​ទាំង​មូល ហើយ​គឺ​ត្រឹមត្រូវ​រហូត​ដល់​ជួរ​ចំនួន​គត់​ត្រូវ​បាន​រក្សា​ទុក​យ៉ាង​ត្រឹមត្រូវ (ប្រហែល ៩ គីឡូក្រាម ឬ 2⁵³) ។ លើស​ពី​នោះ ខ្សែអក្សរ​គោល​ពីរ​វែង​បំផុត ឬ ខ្សែអក្សរ​គោល​ដប់​ប្រាំមួយ​អាច​បាត់បង់​ភាព​ត្រឹមត្រូវ​នៅ​ក្នុង​តួលេខ​ចុងក្រោយ​របស់​ពួក​គេ ។

❤️ ស្នេហា Calculator.Free? ចែករំលែក​វា

𝕏  X Facebook Reddit
API — ប្រើ​ម៉ាស៊ីន​គិតលេខ​នេះ​ពី​កូដ

ទូរស័ព្ទ​ទៅ​ម៉ាស៊ីន​គិតលេខ​នេះ​ជា​ចំណុច​បញ្ចប់ JSON ឥតគិតថ្លៃ - គ្មាន​គ្រាប់ចុច​ដែល​ត្រូវការ ។ ផ្ញើ​តម្លៃ​វាល​ខាងក្រោម​ជា​ប៉ារ៉ាម៉ែត្រ​សំណួរ ឬ JSON ។ អ្វី​ដែល​អ្នក​រំលង​ប្រើ​លំនាំដើម​ដូចគ្នា​ដែល​ទំព័រ​នេះ​ត្រូវ​បាន​បំពេញ​ជាមុន​ជាមួយ​ប៉ារ៉ាម៉ែត្រ​មិន​ស្គាល់​គឺ ៤០០ មិន​មែន​សូន្យ​ស្ងាត់​ទេ ។ អាន​ឯកសារ API ពេញលេញ →

ចំណុច​បញ្ចប់

GET https://calculator.free/api/v1/number-base/

curl

curl "https://calculator.free/api/v1/number-base/?amount=255&from=10&to=2"

JavaScript fetch()

const r = await fetch(
  "https://calculator.free/api/v1/number-base/?" + new URLSearchParams({
    "amount": "255",
    "from": "10",
    "to": "2"
  }));
const data = await r.json();
console.log(data.results);

លទ្ធផលគឺការប៉ាន់ប្រមាណសម្រាប់តែការណែនាំទូទៅប៉ុណ្ណោះ, មិនហិរញ្ញវត្ថុ, វេជ្ជសាស្ត្រឬដំបូន្មានពន្ធ.