Wednesday 26 July 2017

Floating Point Number Into Binary Options


Advanced Binary. Sebelum membaca banyak ke tutorial lanjutan atau master menengah, pastikan untuk melihat dasar-dasar Binary Jika Anda tidak melakukannya, itu bisa menyebabkan kebingungan. Konsep biner yang maju, floating point adalah bagian dari pemrograman sejak awal, tapi Bagaimana komputer menerjemahkan angka desimal ke dalam kode mesin. Dalam tutorial ini, saya akan menjelaskan sistem floating point apa, bagaimana cara menggunakannya dan bagaimana komputer menerjemahkan angka desimal ke biner. Titik api digunakan pada kebanyakan program tunggal atau Bahasa pemrograman, ini adalah salah satu cara yang paling akurat dan efisien untuk menyimpan desimal Setelah tutorial ini, Anda akan dapat memahami struktur floating point s dan bagaimana Anda bisa menggunakan API lain yang memungkinkan Anda untuk membuat ketepatan Anda sendiri yang mengambang. Poin. Floating point sebagian besar disebut sebagai pelampung atau ganda, dalam kebanyakan bahasa, floating point presisi ganda atau ganda digunakan karena menawarkan jangkauan yang lebih luas dan akurasi yang lebih baik daripada Float atau floating point presisi tunggal Beberapa bahasa dan API menawarkan Anda untuk membuat floating point yang lebih besar, atau yang lebih kecil Ini memungkinkan Anda untuk memodifikasi keakuratan dan jangkauan desimal. Poin terapung yang paling terkenal adalah 16 bit setengah, 32 bit tunggal, 64 bit Double, 128 bit quadruple, 256 bit octuple. All floating point memiliki struktur yang serupa, sebuah tanda bit 0 atau 1 yang memberitahu komputer apakah desimalnya negatif atau tidak, eksponen yang memberitahu komputer yang eksponennya 2 digunakan dan Mantissa yang memberi tahu komputer nilai Setiap jenis memiliki tata letak yang berbeda untuk eksponen dan mantissa, tapi tentu saja bit tanda tetap sama, karena ini adalah konsep Boolean. Exponent dan mantissa. Mantissa dan eksponen sering terlihat di Ilmu pengetahuan, seperti kimia, fisika dan biologi Hal ini sering dikenal sebagai notasi ilmiah, di mana Anda meletakkan nomor pertama yang tidak pertama dan menyesuaikan eksponen agar sesuai dengan nilai. Misalnya, 0 15 akan ditulis sebagai 1 5 10 -1, 15 Akan ditulis sebagai 1 5 10 1 Dalam kasus ini, mantissa adalah 1 5 dan eksponennya adalah -1 atau 1.But biner bekerja secara berbeda, karena hanya memiliki 2 pilihan, dalam kasus ini, jika Anda memiliki 1 0101 2 3, yang pertama tidak benar-benar penting karena Anda ingin nomor pertama tidak menjadi 0, jadi akan selalu menjadi 1 Dalam kasus ini, mantissa akan menjadi 0101 dan eksponennya adalah 3 Tentu saja, 1 0101 2 3 berarti 1010 1, yang diterjemahkan menjadi 2 3 2 1 2 -1 8 2 0 5 10 5.Untuk mengubah desimal menjadi floating point Anda dapat menggunakan 3 pendekatan yang berbeda, pendekatan logis, pendekatan matematis dan pendekatan pemrogram Pendekatan logisnya adalah Cara melakukannya tanpa kalkulator atau komputer dengan Anda, cara matematis adalah melakukannya dengan hanya mengisi rumus dan cara pemrogram adalah menjalankan algoritmik. Cara logisnya, apakah Anda berpikir tentang sistem desimal kami, Kami menggunakan titik untuk mencatat bahwa eksponen mulai menjadi negatif 19 31 berarti 1 10 1 9 10 0 3 10 -1 1 10 -2 Jadi numbe biner R dengan desimal di antaranya akan sama, tapi hanya dengan basis 2.Sebuah penjelasan tentang apa arti 11 01 di semi biner. Sekarang, untuk mengubah 11 01 menjadi bilangan biner REAL, Anda perlu menerjemahkannya ke dalam Notasi ilmiah, dalam kasus ini 1 101 2 1 Yang akan membuat eksponen dari 1 dan mantissa dari 101 Kita juga tahu tanda sedikit, yaitu 0, karena tidak ada bilangan negatif. Hal terakhir yang harus ditentukan adalah mantissa dan Eksponen yang ingin Anda gunakan, jika Anda menggunakan ganda, seperti contoh ini, Anda memiliki eksponen 11 bit dan mantissa 52 bit. Eksponen nomor ini tidak hanya 1, ini karena setengah dari eksponen Nilai ini dicadangkan untuk eksponen negatif Ini adalah saat Anda menambahkan 2 eksponen-1 -1 ke eksponen yang kami miliki sebelumnya, jadi akan menjadi 1 2 11-1 -1 0 2 10 1024 100 0000 0000 Yang masuk akal karena setengah dari Nilai eksponen dicadangkan oleh eksponen negatif, 1023 011 1111 1111 sebagai eksponen menjadi 2 0 1022 011 1111 1110 menjadi 2 -1, etc. Fi Nally, mantissa membutuhkan 52 bit, jadi bagi kami mantissa tidak akan menjadi 101, tapi itu akan menjadi nol. Sekarang Anda mengumpulkan eksponen terakhir dan mantissa, dengan tanda tanda 1 sebagai tanda, 100 0000 0000 sebagai eksponen Dan 101 49 nol s seperti mantissa 1100 0000 0000 1010 48 nol s, atau C0 0A 00 00 00 00 00 00.Mengambil konversi dengan logika menjadi formula, kita dapat menentukan beberapa rumus. Kita dapat meningkatkan konversi matematis dengan menambahkan beberapa pasangan Dari operator bitwise Java. public static byte getMantissa double d public static byte getMantissa float f byte static public getExponent double d public static byte getExponent float f public static longLong double d byte e getExponent d byte m getMantissa d byte bit byte em 1 nilai panjang D. Clik di sini untuk mempelajari lebih lanjut tentang Binary. ASCII Lanjutan ke konversi floating point biner bilangan real desimal pada prosesor vektor US 8392489 B2.A sistem, metode, dan aparatus untuk mengubah bilangan real desimal dalam format ASCII menjadi desimal numbe sebenarnya R dalam format desimal biner floating point dalam prosesor vektor dijelaskan Metode ini menghasilkan kinerja konversi dengan cara tanpa cabang dan dalam waktu konstan terlepas dari ukuran string ASCII, dalam kisaran ukuran yang diberikan oleh Arsitektur prosesor vektor Metode ini dapat memanfaatkan satu instruksi multiple data SIMD feature dari prosesor vektor, walaupun tidak terbatas pada satu instruksi. 1.1 Metode algoritmik untuk melakukan konversi konstan-waktu tanpa cabang dari string ASCII bilangan real dari setiap ukuran byte sama dengan atau kurang dari ukuran byte register yang disediakan oleh arsitektur pemrosesan vektor, kata bilangan real yang terdiri dari sebuah byte tanda, bilangan bulat Bagian, bagian pecahan, titik desimal yang memisahkan bagian integer dari bagian pecahan, dan terminator string, ke bilangan biner floating point representasi bilangan real dari string ASCII bilangan real pada prosesor vektor yang memiliki arsitektur pemrosesan vektor, kata biner floating Titik bilangan real representasi dari bilangan real string ASCII yang terdiri dari nilai vektor biner positif atau negatif, sesuai dengan byte tanda positif atau negatif, masing-masing dari bilangan real string ASCII dan memiliki besaran dengan bagian integer dan bagian pecahan dengan desimal Titik yang memisahkan bagian bilangan bulat dari bagian pecahan, metode tersebut terdiri dari, penerapan kode yang terdiri dari perbaikan Urutan edu sejumlah instruksi konstan untuk mengeksekusi satu atau lebih langkah konversi, konversi tersebut selanjutnya terdiri dari, deteksi byte tanda, menetapkan nilai plus atau minus 1, bergantung pada tanda yang positif atau negatif masing-masing, menyimpan nilai ini Dalam daftar prosesor vektor, dan menghapus byte tanda dari string ASCII, deteksi bilangan real dari terminator string, menyelaraskan string ke tepi register prosesor vektor yang memiliki lebar byte sama dengan atau lebih besar dari jumlah karakter di ASCII string real number dan, jika register memiliki lebar byte yang lebih besar dari jumlah karakter dalam bilangan asli string ASCII, masking semua karakter yang tidak terpakai dari sisi berlawanan ke tepi sejajar dengan angka nol menghasilkan satu atau lebih angka nol yang mengarah atau tertinggal. Mendeteksi dan menyimpan dalam daftar prosesor vektor posisi titik desimal yang memisahkan bagian integer dari bilangan real string ASCII dari bagian pecahan o F string ASCII bilangan real dan penghapusan titik desimal dari string ASCII konversi bilangan bulat nyata dari semua satu atau lebih karakter dari string unsigned, tanpa titik desimal, ke dalam byte desimal kode biner yang sesuai untuk membentuk bilangan real biner yang memiliki satu Atau lebih byte, di mana jumlah byte satu atau lebih sesuai dengan jumlah karakter dari string unsigned tanpa titik koma perkalian paralel dari masing-masing nilai desimal kode biner dengan kekuatan sepuluh yang sesuai dengan penempatan masing-masing Nilai desimal kode biner di dalam bilangan biner bilangan real untuk mendapatkan agregasi hasil biner individual dari hasil biner individual dari perkalian paralel menjadi perkalian hasil biner perantara pertama dari hasil biner perantara pertama dengan daya floating point dari sepuluh yang sesuai dengan penempatan Titik desimal untuk mendapatkan hasil biner menengah kedua dan perkalian perantara kedua Hasil biner dengan nilai biner yang ditugaskan pada tanda untuk mendapatkan hasil biner floating point akhir yang ditandatangani. Penemuan ini berhubungan dengan konversi data numerik dalam prosesor vektor. Kode Standar Standar untuk Pertukaran Informasi ASCII ke format konversi floating point biner desimal Bilangan real adalah tugas umum untuk aplikasi seperti pengolahan data perdagangan jasa keuangan Mikroprosesor komoditi mengatasi masalah ini dengan iterasi terhadap digit individual bilangan real dan mengumpulkan hasil parsial sampai karakter pembatas desimal atau karakter pembatas string ditemukan. , Yang mengakhiri proses Karena angka, jika dinyatakan dalam format ASCII, dapat menganggap panjangnya sewenang-wenang, algoritma tradisional memecahkan masalah dalam waktu yang berbanding lurus dengan panjang string yang mewakili angka tersebut, dan kode yang dihasilkan mengandung beberapa cabang, yang dapat Menyebabkan hukuman latency yang parah pada beberapa arsitektur pengolahan modern. Metode Untuk konversi bilangan real dari ASCII ke floating point biner dalam prosesor diketahui. Metode ini mencakup identifikasi posisi awal, akhiran, tanda, dan titik desimal dari bilangan real dalam string ASCII, dengan mengekstrak titik desimal, diikuti dengan mengambil masing-masing Dari tujuh komponen bit dari bilangan real ASCII, satu karakter pada satu waktu, dan mengurangkan bilangan biner, empat puluh delapan, untuk mendapatkan angka desimal yang membentuk bilangan sebenarnya. Kemudian, masing-masing komponen desimal dari bilangan sebenarnya dikalikan Dengan kekuatan sepuluh, dimulai dengan sepuluh pada daya nol, atau satu, untuk digit paling tidak signifikan, sepuluh pada daya pertama, atau sepuluh, untuk digit di sebelah kiri digit paling penting, jika ada, sepuluh ke Kekuatan kedua, atau seratus, untuk digit di sebelah kiri digit sebelumnya, jika ada, dll. Hal ini diulang untuk jumlah digit yang terdiri dari bilangan real, sampai dan termasuk digit yang paling signifikan. Masing-masing produk ini kemudian diakumulasikan. Dan tanda tambah, menghasilkan bilangan desimal desimal biner Untuk memproses nomor ini ke dalam format floating point, posisi, yang diidentifikasi di atas, agar titik desimal digeser ke kiri sampai hanya satu digit nol nol yang tertinggal di sebelah kiri. Posisi titik desimal Ini disebut normalisasi Sesuai dengan pergeseran ini, jumlah posisi bergeser dicatat sehingga jumlah yang dihasilkan dari satu digit nol digit diikuti oleh titik desimal, diikuti oleh fraksi dapat dikalikan dengan radix yang dinaikkan ke daya Dari jumlah titik desimal pergeseran representasi floating point terakhir adalah tanda, bilangan real atau mantissa, dan fraksi, atau eksponen. Salah satu masalah dengan teknik ini adalah karena iteratif, waktu untuk konversi akan bervariasi, Menjadi lebih lama seperti ukuran string bilangan asli ASCII meningkat Masalah lainnya adalah kode untuk melakukan fungsi konversi melibatkan percabangan dan penggunaan beberapa instruksi, juga menambah Waktu eksekusi dan efisiensi konversi, karena masalah latency. Untuk mengatasi masalah yang disajikan di atas, penemuan ini menyediakan sistem, kode, dan metode algoritmik dengan tujuan untuk melakukan konversi format tanpa waktu tanpa cabang dengan memanfaatkan sifat pemrosesan paralel dari Instruksi instruksi multi instruksi tunggal modern, SIMD, arsitektur pemrosesan vektor Keuntungannya adalah prediktabilitas yang jauh lebih tinggi dari waktu eksekusi, dan kinerja keseluruhan yang lebih tinggi pada prosesor vektor modem yang kurang mentolerir pengendalian aliran program yang canggih Prediktabilitas dan kinerja tambahan membuat metode ini lebih sesuai. Daripada yang tradisional dalam aplikasi pengolahan data berkinerja tinggi dan dalam sistem real-time yang lembut berdasarkan prosesor vektor. Ini adalah tujuan lebih lanjut dari penemuan ini untuk menyediakan arsitektur prosesor vektor, pemilihan kode, dan metode untuk mengubah bilangan asli ASCII yang ditandatangani. Dari berbagai ukuran ke titik desimal yang ditandatangani, floating point, biner Bilangan real dalam prosesor vektor dimana waktu konversi akan konstan terlepas dari ukuran bilangan real ASCII dalam kisaran ukuran yang diberikan oleh arsitektur prosesor vektor. Untuk mencapai tujuan ini, sistem menggunakan kode yang, ketika dieksekusi, Menerapkan satu atau lebih langkah dari metode algoritmik untuk melakukan konversi waktu konstan tak berdimin dari bilangan real string ASCII, kata bilangan real yang terdiri dari byte tanda, bagian bilangan bulat, bagian pecahan, titik desimal yang memisahkan bagian integer dari bagian pecahan , Dan sebuah terminator string, ke bilangan desimal desimal floating point bilangan real representasi pada prosesor vektor Kode terdiri dari urutan tetap dari sejumlah instruksi konstan. Termasuk dalam metode algoritmik adalah deteksi byte tanda dan penugasan nilai biner yang unik. Untuk kata tanda byte tergantung pada tanda yang positif atau negatif Juga termasuk adalah deteksi paralel dari terminator string dan masking dari semua un Karakter yang digunakan serta pendeteksian paralel titik desimal yang memisahkan bagian bilangan bulat dari bilangan dari bagian pecahan angka. Langkah selanjutnya mencakup, konversi paralel semua karakter string menjadi nilai desimal biner yang sesuai, penggandaan paralel masing-masing Nilai desimal biner dengan kekuatan sepuluh yang sesuai dengan penempatan masing-masing nilai desimal biner di dalam bilangan desimal untuk mendapatkan hasil biner individual, sebuah agregasi dari hasil biner individual dari perkalian paralel menjadi hasil biner perantara pertama, perkalian dari Hasil biner intermediate pertama dengan daya floating point dari sepuluh yang sesuai dengan penempatan titik desimal untuk mendapatkan hasil biner menengah kedua, dan perkalian hasil biner perantara kedua dengan nilai biner yang ditugaskan pada tanda untuk mendapatkan titik akhir floating Hasil desimal biner. Untuk mencapai tujuan konversi waktu konstan , Arsitektur prosesor vektor dan kode dirancang sedemikian rupa sehingga, ketika dijalankan, kode tersebut memecahkan bilangan real sampai dua atau lebih bagian dan memuat setiap bagian menjadi satu atau lebih register ukuran tetap dari mana operasi konversi termasuk mengurangkan biner empat puluh delapan dari Masing-masing digit bilangan asli ASCII dan dikalikan dengan kekuatan sepuluh yang sesuai dilakukan secara paralel. Sementara penemuan ini tidak memaksakan, berdasarkan metode, kode, atau arsitektur, penggunaan instruksi tunggal, ini adalah tujuan selanjutnya. Penemuan untuk menyediakan prosesor vektor yang mampu melakukan konversi dengan menggunakan satu instruksi. Untuk mencapai tujuan lebih lanjut ini untuk menyediakan prosesor vektor yang mampu melakukan konversi dengan satu instruksi tunggal instruksi instruksi ganda tunggal yang melekat, SIMD, kemampuan vektor Prosesor digunakan dalam kombinasi dengan kode yang dirancang dengan fungsi SIMD dalam perancangan prosesor vektor. DESCRIPTION OF GAMBAR. FIG 1 Aliran ASCII ke titik terapung bilangan biner bilangan desimal nyata dalam prosesor vektor. Uraian Lengkap Penemuan. FIG 1 mewakili aliran perwujudan yang disukai dari penemuan Ini menunjukkan langkah dan register yang terlibat dalam eksekusi tanpa cabang tanpa batas waktu. Bilangan real ASCII ke floating point binary decimal conversion dalam prosesor vektor Nilai bilangan asli ASCII dapat bernilai sama dengan, kurang dari atau lebih besar dari nol dan terdiri dari sejumlah digit, dengan bilangan bulat, bagian pecahan, dan desimal Titik antara bilangan bulat dan bagian pecahan. Dalam contoh gambar 1, angka sebenarnya kurang dari nol, oleh karena itu angka negatif, yang nilai absolutnya adalah 234567890 12 Jadi, angka pada contoh terdiri dari tanda minus, bilangan bulat, 234567890, terdiri dari sembilan digit, bagian pecahan, 12 terdiri dari dua digit, dan titik desimal antara bilangan bulat dan bagian fraksional. FIG 1 menggambarkan langkah-langkah operasional, hasil, dan Register yang digunakan pada contoh. Pada langkah 1, pertama dari sejumlah instruksi berurutan dijalankan untuk konversi desimal biner ASCII ke floating point dan nomor ASCII diambil dari memori. Dalam perwujudan ini, bilangan real terkandung dalam byte 32 Kata, 1 dan tidak berada pada batas kata Angka sebenarnya terdeteksi sebagai antara bit tanda dan terminator string. Pada langkah 2, byte pertama kata yang diisikan sejajar dengan byte pertama dari register vektor 16-byte pertama, 2 dan byte terakhir kata selaras dengan byte terakhir dari register vektor 16 byte kedua, 3 sehingga bagian dari string ASCII ada di register pertama, 2 dan bagiannya ada di register kedua, 3. Pada langkah 3 Isi register pertama dan kedua, 2 dan 3 dimasukkan ke register 16 byte ketiga, 4 sehingga byte paling kiri berisi tanda dan byte berikut di sebelah kanan berisi digit angka sebenarnya, termasuk titik desimal dan String terminator. Pada langkah 4 tanda adalah d Diartikan, dilucuti dari kata, dan representasi biner dari polaritas tanda disimpan dalam register satu byte, 5. Pada langkah 5, terminator string terdeteksi, dan digit yang tersisa dari bilangan real digeser ke kanan yang dibenarkan. Posisi seperti ditunjukkan pada 6 Karakter utama yang tidak terpakai bertopeng sebagai angka nol. Pada langkah 6, jumlah posisi di sebelah kanan titik desimal dideteksi dan disimpan dalam register satu byte, 7 Kemudian titik desimal dilucuti, sedangkan bilangan bulat Digeser satu posisi ke kanan dan nol terdepan dimasukkan ke posisi paling kiri seperti ditunjukkan pada 8 untuk membentuk bilangan real sebelas digit tanpa titik desimal. Pada langkah 7 desimal biner empat puluh delapan dikurangkan dari setiap karakter kata di Daftar langkah 6 untuk melakukan konversi desimal biner ASCII ke setiap digit bilangan real. Pada langkah 8, kata bilangan real sebenarnya sebelas byte dibagi menjadi empat potongan empat byte dan dipromosikan menjadi empat kata bilangan bulat pendek dari enam belas byte masing-masing. sebagai Ditunjukkan pada 10 11 12 dan 13. Pada langkah 9 a sampai 9 d masing-masing kata-kata integer pendek adalah vektor dikalikan dengan kata delapan byte, 14 terdiri dari bilangan desimal desimal biner alternatif dan kekuatan sepuluh yang sesuai sehingga empat desimal biner empat byte Kata, 15 16 17 dan 18 hasil. Pada langkah 10, isi dari masing-masing kata desimal biner empat byte, hasil 15 16 17 dan 18 ditambahkan secara horizontal, menghasilkan empat angka desimal, 19 20 21 dan 22. Pada langkah 11 Angka yang dihasilkan, 19 20 dan 22 diubah menjadi bilangan floating point dengan menempatkan titik desimal, diikuti oleh nol, di sebelah kanan jumlah terakhir masing-masing Hasil konversi floating point, dari angka 19 dan 20 ditempatkan di sebelahnya. Satu sama lain dalam kata, 23 Jumlah yang tersisa, 21 adalah skalar pertama yang dikalikan sepuluh dengan kekuatan empat, atau desimal 10.000, sebelum dikonversi menjadi floating point dengan menempatkan titik desimal, diikuti oleh nol, di sebelah kanan Nomor terakhir Hasil ini, bersama dengan poin mengambang T konversi dari 22 ditempatkan berdekatan satu sama lain dalam kata 24. Pada langkah 12 kiri, setengah kata dalam 23 adalah vektor dikalikan dengan sepuluh untuk kekuatan dua belas, terwakili dalam floating point sebagai 1000000000000 0f dan kanan, setengah kata dari 23 adalah Vektor dikalikan sepuluh dengan kekuatan delapan, terwakili dalam floating point sebagai 100000000 0f untuk membentuk dua kata setengah baru yang berdekatan seperti yang ditunjukkan pada 25. Pada langkah 13, penambahan vektor horisontal dilakukan pada dua kata setengah yang berdekatan di 25 dan dua di sebelahnya. Setengah kata dalam 24 dengan hasil masing-masing ditempatkan pada 26 dan 27. Pada langkah 14, penambahan skalar dilakukan pada hasil pada 26 dan 27 dengan hasil ditempatkan pada 28. Pada langkah 15, jumlah posisi di sebelah kanan desimal di Bilangan asli ASCII string asli, yang diperoleh pada langkah 6 dan disimpan dalam 7 digunakan bersamaan dengan pecahan untuk melihat tabel, 29 untuk mendapatkan kekuatan negatif sepuluh, dalam contoh ini, sepuluh ke minus dua, terwakili sebagai floating Titik 0 01f seperti ditunjukkan pada 30. Pada langkah 1 6 perkalian skalar dari hasil pada 28 dari langkah 14 dengan bilangan floating point di 30 dilakukan dan hasilnya ditempatkan pada 31. Pada langkah 17, sebuah perkalian skalar menghasilkan 31 dengan representasi biner dari polaritas tanda, yang diperoleh dari langkah 4 dan disimpan dalam register (5) dilakukan dengan representasi floating point terakhir dari bilangan real string ASCII yang ditempatkan pada 32. Sementara perwujudan dari Gambar 1 menunjukkan contoh pelaksanaan konversi floating point pada prosesor vektor dengan menggunakan senar ASCII yang terdiri dari Sebuah tanda, bagian integer 9 digit, titik desimal, bagian pecahan 2 digit, dan terminator string, arsitektur prosesor dan kode dapat disesuaikan untuk mendukung string ukuran yang terdiri dari jumlah digit yang lebih banyak, dengan kombinasi hierarkis. Dari proses yang sama selama beberapa bagian dari string ASCII, masih memberikan waktu konversi yang konstan, walaupun lebih lama. Seperti yang dinyatakan di atas, ukuran bilangan sebenarnya ASCII dapat bervariasi dari 1 digit sampai jumlah Digit sampai jumlah maksimal yang telah ditentukan, namun melalui penerapan alat dan operasi aritmatika paralel, pemilihan kode yang tepat, dan dengan merancang jumlah dan panjang register dan atau ukuran kata, waktu eksekusi dari Konversi akan tetap konstan untuk setiap ukuran string dalam rentang desain dan konversi akan tercapai tanpa percabangan. Sementara perwujudan dari Gambar 1 menunjukkan eksekusi yang lebih disukai dari konversi format bilangan real dalam prosesor vektor, konversi tidak perlu dilakukan pada Jumlah pasti atau urutan langkah yang ditunjukkan selama penerapan operasi aritmatika paralel dan satu atau lebih kumpulan instruksi jumlah urutan tetap konstan digunakan untuk mengurangi waktu eksekusi dan meningkatkan efisiensi konversi.9 4 desimal Desimal titik tetap Dan aritmatika floating point. Baru di versi 2. 4. Modul desimal memberikan dukungan untuk desimal floating point arithmetic Ini menawarkan severa Saya memiliki kelebihan dibanding tipe datatype float. Decimal didasarkan pada model floating-point yang dirancang dengan pemikiran orang, dan tentunya memiliki prinsip dasar komputer harus menyediakan aritmatika yang bekerja dengan cara yang sama seperti aritmatika yang dipelajari orang di sekolah. Kutipan dari spesifikasi aritmatika desimal. Nomor desimal dapat diwakili dengan tepat Sebaliknya, angka seperti 1 1 dan 2 2 tidak memiliki representasi yang tepat pada titik terapung biner Pengguna akhir biasanya tidak akan mengharapkan 1 1 2 2 untuk ditampilkan sebanyak 3 3000000000000003 seperti halnya Dengan titik koma floating point. Kearsipan membawa ke dalam aritmatika Dalam desimal floating point, 0 1 0 1 0 1 - 0 3 sama persis dengan nol Dalam floating point biner, hasilnya adalah 5 5511151231257827e-017 Sementara mendekati nol, perbedaannya mencegah Pengujian kesetaraan yang dapat diandalkan dan perbedaan dapat terakumulasi Untuk alasan ini, desimal lebih disukai dalam aplikasi akuntansi yang memiliki invarian equariants yang ketat. Modul desimal menggabungkan Pengertian tempat yang signifikan sehingga 1 30 1 20 adalah 2 50 Titik nol yang tertinggal dijaga untuk menunjukkan signifikansi Ini adalah presentasi biasa untuk aplikasi moneter Untuk perkalian, pendekatan buku sekolah menggunakan semua gambar dalam multiplicands Misalnya, 1 3 1 2 memberi 1 56 sementara 1 30 1 20 memberi 1 5600.Tidak seperti perangkat keras berbasis floating point biner, modul desimal memiliki kemiripan presisi yang dapat diubah pengguna menjadi 28 tempat yang dapat sama besar dengan kebutuhan untuk masalah tertentu. Titik biner dan desimal floating point diimplementasikan Dalam hal standar yang diterbitkan Sementara jenis float built-in hanya memperlihatkan sebagian kecil kemampuannya, modul desimal memaparkan semua bagian standar yang dipersyaratkan. Bila diperlukan, pemrogram memiliki kontrol penuh atas pembulatan dan penanganan sinyal Ini mencakup opsi untuk menegakkan Aritmatika yang tepat dengan menggunakan pengecualian untuk menghalangi operasi yang tidak tepat. Modul desimal dirancang untuk mendukung tanpa prasangka, kedua aritmetika desimal yang tidak terdekade C kadang-kadang disebut fixed-point arithmetic dan rounded floating-point arithmetic excerpt dari spesifikasi aritmatika desimal. Desain modul berpusat di sekitar tiga konsep bilangan desimal, konteks untuk aritmatika, dan sinyal. Angka desimal tidak berubah. Ada tanda, Angka koefisien, dan eksponen Untuk melestarikan signifikansi, angka koefisien tidak memotong nol trailing desimal Juga termasuk nilai khusus seperti Infinity-Infinity dan NaN Standar juga membedakan -0 dari 0. Konteks untuk aritmatika adalah lingkungan yang menentukan presisi, pembulatan Aturan, batasan pada eksponen, bendera yang menunjukkan hasil operasi, dan perangkap enabler yang menentukan apakah sinyal diperlakukan sebagai pengecualian Opsi pembulatan mencakup ROUNDCEILING ROUNDDOWN ROUNDFLOOR ROUNDHALFDOWN ROUNDHALFEVEN ROUNDHALFUP ROUNDUP dan ROUND05UP. Signals adalah kelompok dengan kondisi luar biasa yang timbul selama perhitungan dihitung Tergantung Pada kebutuhan aplikasi, sinyal Dapat diabaikan, dianggap sebagai informasi, atau diperlakukan sebagai pengecualian Sinyal dalam modul desimal disingkat InvalidOperation DivisionByZero Inexact Rounded Subnormal Overflow dan Underflow. Untuk setiap sinyal ada bendera dan perangkap enabler Bila sinyal ditemukan, maka flag-nya disetel. Untuk satu, kemudian, jika perangkap enabler diatur ke satu, pengecualian diajukan Bendera yang lengket, sehingga pengguna perlu mengatur ulang sebelum melakukan pemantauan perhitungan.9 4 1 Tutorial mulai cepat. Awal yang biasa untuk menggunakan desimal adalah mengimpor Modul, melihat konteks saat ini dengan getcontext dan, jika perlu, menetapkan nilai baru untuk perangkap presisi, pembulatan, atau peralihan yang dapat diaktifkan. Contoh maksimal dapat dibangun dari bilangan bulat, string, pelampung, atau tupel Konstruksi dari bilangan bulat atau pelampung menghasilkan yang tepat. Konversi nilai integer atau float Angka desimal termasuk nilai khusus seperti NaN yang merupakan singkatan dari Not a number, positive dan negative Infinity dan -0. Arti dari Desimal baru i S ditentukan semata-mata oleh jumlah digit masukan Konteks presisi dan pembulatan hanya ikut bermain selama operasi aritmatika. Semangat berinteraksi dengan baik dengan banyak sisa Python Berikut adalah titik desimal kecil floating point flying circus. Dan beberapa fungsi matematika juga tersedia untuk Desimal. . Metode kuantitatif mengumpulkan angka ke eksponen tetap Metode ini berguna untuk aplikasi moneter yang sering menghasilkan banyak tempat. Seperti ditunjukkan di atas, fungsi getcontext mengakses konteks saat ini dan memungkinkan pengaturannya diubah Pendekatan ini memenuhi Kebutuhan kebanyakan aplikasi. Untuk pekerjaan yang lebih maju, mungkin berguna untuk membuat konteks alternatif menggunakan konstruktor Konteks Untuk membuat alternatif aktif, gunakan fungsi setcontext. Sesuai dengan standarnya, modul desimal menyediakan dua konteks standar siap pakai. , BasicContext dan ExtendedContext Yang pertama sangat berguna untuk debugging karena banyak perangkap diaktifkan. Konteks juga Memiliki flag sinyal untuk memantau kondisi luar biasa yang dihadapi selama penghitungan Bendera tetap ditetapkan sampai dibersihkan secara eksplisit, jadi yang terbaik adalah membersihkan bendera sebelum setiap rangkaian perhitungan yang dipantau dengan menggunakan metode clearflags. Entri bendera menunjukkan bahwa perkiraan rasional terhadap Pi dibulatkan Digit di luar ketepatan konteks dibuang dan hasilnya tidak tepat beberapa digit yang dibuang adalah non-zer. Perangkap individu ditetapkan menggunakan kamus di bidang perangkap dalam konteks. Sebagian besar program menyesuaikan konteks saat ini hanya sekali, di Awal program Dan, dalam banyak aplikasi, data dikonversi menjadi Desimal dengan pemeran tunggal dalam satu lingkaran Dengan himpunan dan desimal yang dibuat, sebagian besar program memanipulasi data tidak berbeda dengan tipe numerik Python lainnya.9 4 2 Desimal Objects. Construct sebuah objek Desimal baru yang berbasis dari value. value bisa berupa integer, string, tuple, float atau objek Decimal lainnya Jika tidak ada nilai yang diberikan, return D Ecimal 0 Jika nilai adalah sebuah string, itu harus sesuai dengan sintaks string numerik desimal setelah karakter spasi terdepan dan karakter pelepasan dihapus. Jika nilainya adalah string unicode maka digit desimal Unicode lainnya juga diizinkan di mana angka muncul di atas Ini termasuk angka desimal dari berbagai Huruf lain misalnya, digit Arab-Indic dan Devangar bersama dengan digit penuh u uff10 melalui u uff19. Jika nilainya adalah tupel maka seharusnya ada tiga komponen, tanda 0 untuk bilangan positif atau 1 untuk bilangan negatif, tuple digit, dan satu Eksponen integer Misalnya, Desimal 0, 1, 4, 1, 4, -3 mengembalikan Desimal 1 414. Jika nilainya mengambang, nilai floating rate biner secara losslessly dikonversi ke desimal desimalnya yang sebenarnya Konversi ini seringkali memerlukan 53 digit atau lebih Dari presisi Misalnya, pelampung Decimal 1 1 mengkonversi ke Desimal 1 100000000000000088817841970012523233890533447265625. Ketepatan konteks tidak mempengaruhi jumlah digit yang tersimpan. Yang ditentukan secara eksklusif oleh mati rasa. Eh angka dalam nilai Misalnya, Desimal 3 00000 mencatat kelima angka nol bahkan jika ketepatan konteksnya hanya tiga. Tujuan dari argumen konteks adalah menentukan apa yang harus dilakukan jika nilai adalah string yang salah Jika perangkap konteks InvalidOperation pengecualian dinaikkan Jika tidak, konstruktor mengembalikan Desimal baru dengan nilai NaN. Setelah selesai dibangun, objek desimal tidak berubah. Ditandai dalam versi 2 6 karakter spasi dan karakter terdepan diijinkan saat membuat contoh Desimal dari sebuah string. Dikatakan dalam versi 2 7 Argumen Ke konstruktor sekarang diizinkan untuk menjadi instance float. Objek floating point yang sederhana berbagi banyak properti dengan tipe numerik built-in lainnya seperti float dan int Semua operasi matematika biasa dan metode khusus berlaku. Demikian juga, objek desimal dapat disalin, Acar, dicetak, digunakan sebagai tombol kamus, digunakan sebagai elemen yang disetel, dibandingkan, diurutkan, dan dipaksakan ke tipe lain seperti float atau long. Ada beberapa perbedaan kecil antara Aritmatika pada objek desimal dan aritmatika pada bilangan bulat dan pelampung Bila operator sisanya diterapkan pada objek desimal, tanda hasilnya adalah tanda dividen daripada tanda pembagi. Operator divisi integer berperilaku analog, mengembalikan bagian bilangan bulat of the true quotient truncating towards zero rather than its floor, so as to preserve the usual identity xxyyx y. The and operators implement the remainder and divide-integer operations respectively as described in the specification. Decimal objects cannot generally be combined with floats in arithmetic operations an attempt to add a Decimal to a float for example, will raise a TypeError There s one exception to this rule it s possible to use Python s comparison operators to compare a float instance x with a Decimal instance y Without this exception, comparisons between Decimal and float instances would follow the general rules for comparing objects of different types described in the Expressions section of the reference manual, leading to confusing results. Changed in version 2 7 A comparison between a float instance x and a Decimal instance y now returns a result based on the values of x and y In earlier versions x y returned the same arbitrary result for any Decimal instance x and any float instance y. In addition to the standard numeric properties, decimal floating point objects also have a number of specialized methods. Return the adjusted exponent after shifting out the coefficient s rightmost digits until only the lead digit remains returns seven Used for determining the position of the most significant digit with respect to the decimal point. Return a named tuple representation of the number DecimalTuple sign, digits, exponent. Changed in version 2 6 Use a named tuple. Return the canonical encoding of the argument Currently, the encoding of a Decimal instance is always canonical, so this operation returns its argument unchanged. New in version 2 6pare the values of two Decimal instances This operation behaves in the same way as the usual comparison method cmp except that compare returns a Decimal instance rather than an integer, and if either operand is a NaN then the result is a NaN. This operation is identical to the compare method, except that all NaNs signal That is, if neither operand is a signaling NaN then any quiet NaN operand is treated as though it were a signaling NaN. New in version 2 6pare two operands using their abstract representation rather than their numerical value Similar to the compare method, but the result gives a total ordering on Decimal instances Two Decimal instances with the same numeric value but different representations compare unequal in this ordering. Quiet and signaling NaNs are also included in the total ordering The result of this function is Decimal 0 if both operands have the same representation, Decimal -1 if the first operand is lower in the total order than the second, and Decimal 1 if the first operand is higher in the total order than the second operand See the specification for details of the total order. New in version 2 6pare two operands using their abstract representation rather than their value as in comparetotal but ignoring the sign of each operand is equivalent to. New in version 2 6.Just returns self, this method is only to comply with the Decimal Specification. New in version 2 6.Return the absolute value of the argument This operation is unaffected by the context and is quiet no flags are changed and no rounding is performed. New in version 2 6.Return the negation of the argument This operation is unaffected by the context and is quiet no flags are changed and no rounding is performed. New in version 2 6.Return a copy of the first operand with the sign set to be the same as the sign of the second operand For example. This operation is unaffected by the context and is quiet no flags are changed and no rounding is performed. New in version 2 6.Return the value of the natural exponential function e x at the given number The result is correctly rounded using the ROUNDHALFEVEN rounding mode. New in version 2 6.Classmethod that converts a float to a decimal number, exactly. Note is not the same as Decimal 0 1 Since 0 1 is not exactly representable in binary floating point, the value is stored as the nearest representable value which is 0x1 999999999999ap-4 That equivalent value in decimal is 0 1000000000000000055511151231257827021181583404541015625.From Python 2 7 onwards, a Decimal instance can also be constructed directly from a float. Q Once I have valid two place inputs, how do I maintain that invariant throughout an application. A Some operations like addition, subtraction, and multiplication by an integer will automatically preserve fixed point Others operations, like division and non-integer multiplication, will change the number of decimal places and need to be followed-up with a quantize step. In developing fixed-point applications, it is convenient to define functions to han dle the quantize step. Q There are many ways to express the same value The numbers 200 200 000 2E2 and 02E 4 all have the same value at various precisions Is there a way to transform them to a single recognizable canonical value. A The normalize method maps all equivalent values to a single representative. Q Some decimal values always print with exponential notation Is there a way to get a non-exponential representation. A For some values, exponential notation is the only way to express the number of significant places in the coefficient For example, expressing 5 0E 3 as 5000 keeps the value constant but cannot show the original s two-place significance. If an application does not care about tracking significance, it is easy to remove the exponent and trailing zeros, losing significance, but keeping the value unchanged. Q Is there a way to convert a regular float to a Decimal. A Yes, any binary floating point number can be exactly expressed as a Decimal though an exact conversion may take mor e precision than intuition would suggest. Q Within a complex calculation, how can I make sure that I haven t gotten a spurious result because of insufficient precision or rounding anomalies. A The decimal module makes it easy to test results A best practice is to re-run calculations using greater precision and with various rounding modes Widely differing results indicate insufficient precision, rounding mode issues, ill-conditioned inputs, or a numerically unstable algorithm. Q I noticed that context precision is applied to the results of operations but not to the inputs Is there anything to watch out for when mixing values of different precisions. A Yes The principle is that all values are considered to be exact and so is the arithmetic on those values Only the results are rounded The advantage for inputs is that what you type is what you get A disadvantage is that the results can look odd if you forget that the inputs haven t been rounded. The solution is either to increase precision or t o force rounding of inputs using the unary plus operation. Conversion of floating-point numbers from binary into string format US 20070203965 A1.A method, system, and computer program product that convert a real number from a floating point representation to a character string Mantissa bits are extracted from the floating-point representation of a value into an integer format The mantissa bits of the integer format may be shifted left by a number of positions that is equal to a base 2 exponent of a first representation of the value Prior to converting the value, the floating-point representation of the value can be divided by 2 n where n is the number of the mantissa bits in the floating-point representation of the value A set of operations can then be performed to convert a result of the division to a number greater than or equal to 1 0 and less than 10 0 The set of operations may include multiplication operations and or retrieving a constant from a lookup table. 20.1 A method comprising. converting a value from a floating-point representation of the value to a character string, wherein the converting comprises. extracting mantissa bits from the floating-point representation into a first integer. converting the first integer to the character string.2 The method of claim 1 further comprising. calculating a second integer by shifting the mantissa bits in the first integer by a number of positions, wherein. the converting the first integer to the character string comprises converting the second integer to the character string.3 The method of claim 2 wherein. the number of positions by which the mantissa bits are shifted is equal to a base 2 exponent of a first representation of the value, and. the mantissa bits are shifted left.4 The method of claim 2 further comprising. prior to converting the value, performing the following. dividing the floating-point representation of the value by 2 n. where the n is a number of the mantissa bits in the floating-point r epresentation of the value and. performing a set of operations to convert a result of the dividing to a number greater than or equal to 1 0 and less than 10 0.5 The method of claim 4 wherein. the set of operations comprises a lookup operation and a multiplication operation. the lookup operation retrieves a constant from a lookup table, and. the multiplication operation multiplies a current representation of the value by the constant.6 The method of claim 5 wherein. the lookup table further comprises a value of a base 10 exponent for a result of the multiplication operation.7 The method of claim 4 wherein. the set of operations is a set of multiplication operations, and. the set of multiplication operations comprises no more than a maximum number of multiplication operations.8 The method of claim 7 wherein. if a number of bits in an exponent of the floating-point representation of the value is 11, the maximum number of multiplication operations is 9.9 The method of claim 8 further comprising. fo r each multiplication operation in the set of multiplication operations. adding a corresponding value to a variable, wherein. the variable is used to calculate a base 10 exponent to be appended to the character string representing the value.10 A computer-readable medium comprising. converting instructions to convert a value from a floating-point representation of the value to a character string. extracting instructions to extract mantissa bits from the floating-point representation into a first integer and. second converting instructions to convert the first integer to the character string.11 The computer-readable medium of claim 10 further comprising. calculating instructions to calculate a second integer by shifting the mantissa bits in the first integer by a number of positions, wherein. converting the first integer to the character string comprises converting the second integer to the character string.12 The computer-readable medium of claim 10 further comprising. dividing instructions to divide the floating-point representation of the value by 2 n. where the n is a number of the mantissa bits in the floating-point representation of the value and. performing instructions to perform a set of operations to convert a result of the dividing to a number greater than or equal to 1 0 and less than 10 0.13 The computer-readable medium of claim 12 wherein. the set of operations comprises a lookup operation and a multiplication operation. the lookup operation retrieves a constant from a lookup table, and. the multiplication operation multiplies a current representation of the value by the constant.14 The computer-readable medium of claim 13 wherein. the lookup table further comprises a value of a base 10 exponent for a result of the multiplication operation.15 The computer-readable medium of claim 12 wherein. the set of operations is a set of multiplication operations, and. the set of multiplication operations comprises no more than a maximum number of multiplication operations.16 The co mputer-readable medium of claim 15 further comprising. an adding module to add a corresponding value to a variable for each multiplication operation in the set of multiplication operations, wherein. the variable is used to calculate a base 10 exponent to be appended to the character string representing the value.17 A computer system comprising. a processor to execute instructions and. a memory, wherein. the memory is coupled to the processor, and. the memory comprises the computer-readable medium of claim 12.18 The computer system of claim 17 wherein the computer-readable medium further comprises. calculating instructions to calculate a second integer by shifting the mantissa bits in the first integer by a number of positions, wherein. converting the first integer to the character string comprises converting the second integer to the character string.19 The computer system of claim 17 wherein the computer-readable medium further comprises. dividing instructions to calculate the floating-point r epresentation of the value by 2 n. where the n is a number of the mantissa bits in the floating-point representation of the value and. performing instructions to perform a set of operations to convert a result of the dividing to a number greater than or equal to 1 0 and less than 10 0.20 A system comprising. converting means for converting a value from a floating-point representation of the value to a character string. extracting means for extracting mantissa bits from the floating-point representation into a first integer and. second converting means for converting the first integer to the character string. CROSS-REFERENCE TO RELATED APPLICATION. This invention claims priority to Provisional Patent Application Ser No 60 667,192, entitled CONVERSION OF FLOATING-POINT NUMBERS FROM BINARY INTO STRING FORMAT , filed Mar 31, 2005, and naming Nathan Luther Reynolds as inventor This provisional patent application is incorporated herein by reference, in its entirety and for all purposes. Portions of this patent application contain materials that are subject to copyright protection The copyright owner has no objection to the facsimile reproduction by anyone of the patent document, or the patent disclosure, as it appears in the Patent and Trademark Office file or records, but otherwise reserves all copyright rights whatsoever. BACKGROUND OF THE INVENTION. Many large businesses wish to take advantage of widespread use of the Internet to communicate with customers However, communication protocols on the Internet are designed to deal primarily with text data, whereas numerical data is typically stored on computers in a non-text format IEEE Standard 754 floating-point representation is the most commonly-used representation for real numbers on computers IEEE Standard 754 floating-point representation represents real numbers in scientific notation, where each number has a mantissa, a base, and an exponent For example, 62 25 could be represented as 62 25 10 0 where the mantissa is 62 25, the base is 10 and the exponent is 0 indicating multiplication by 1 Preferably, floating-point numbers are stored in normalized form, which places the decimal point after the first non-zero digit In normalized form, 62 25 is represented as 6 225 10 1 Computers store data in binary format, also referred to as base 2 numbers, which have digits that are either 1s or 0s 62 25 in binary format is 111110 01 2 0 or 1 1111001 2 5 normalized. An important goal in the design of floating-point representation of numbers is to provide a representation that can approximate real numbers to a certain degree of accuracy Consequently, a floating-point representation embodies the notions of significant digits and the location of the decimal point IEEE Standard 754 floating-point numbers have three basic components the sign, the exponent, and the mantissa The base of 2 is not explicitly represented The sign bit indicates whether the number is positive or negative The mantissa is composed of a fraction, which corresponds to the significant digits, and may include an implicit leading digit For example, in base 2, since the only possible non-zero digit is 1, a leading digit can be assumed and is not required to be stored explicitly, thereby saving storage space and increasing accuracy The exponent indicates the location of the decimal point. FIG 1 shows the components of a floating-point representation of a real number and its binary equivalent FIG 1 includes various representations, including the IEEE 754 8-byte format, of the decimal number 3 14159 In exponential form, the number is represented as 3 14159 10 0 As a binary number, the number is represented as 11 0010010000111111001111100000001 trailing zeros are omitted in this example In binary exponential form, the number is shown as 1 10010010000111111001111100000001 2 1 In binary IEEE 754 8-byte form, the number has a one-bit sign component having a value of 0, indicating that the number is positive The IEEE 754 8-byte form also includes an 11-bit exponent, in this example having a value of 100 0000 0000 Because the exponent field needs to represent both positive and negative exponents, a bias is added to the actual exponent to obtain the stored exponent For IEEE 754 8-byte format, the bias is 1023 Thus, the value in the example of FIG 1 is 1024 indicating an exponent of 1 1024 1023.The 52-bit mantissa, also known as a significand, represents the significant bits, also referred to as precision bits, of the number In IEEE 754 8-byte format, the mantissa includes an implicit leading bit and the fraction bits In FIG 1 the mantissa has a value of 10010010000111111001111100000001 the leading 1 of the binary exponential form is not shown because it is implicit, and trailing zeros are not shown Before printing a number in IEEE 754 8-byte format, the stored value is usually converted from base 2 to a character string. In IEEE 754 8-byte format, the largest and smallest binary numbers that can be represented are 2 2 52 1023 The largest and smallest decimal numbers that can be represented are approximately 10 308 Known conversion techniques may require up to 325 multiplication operations 308 for processing the exponent and one for each digit of a possible 17 digits in the mantissa to convert the largest possible floating-point number to a character string With web pages displaying numerous numerical values as character strings, conversion of real numbers to character strings can consume a substantial amount of CPU time and greatly reduce performance of web-based applications In one example, CPU processing time spent by a web server to produce web pages and reports was analyzed In that analysis, 67 of the CPU processing time of the web server was consumed by conversion of the floating-point representations of numbers into character strings Similarly, another analysis of time spent by a Pentium IV processor using standardized conversion functions in a commonly available run-time library required from 6,000 to 14 ,000 cycles for each floating-point number converted to a character string. What is needed is the ability to convert a floating-point representation of a number to a character string quickly, efficiently, and accurately Preferably the technique would be useable by web servers in producing web pages and reports as well as by other software converting numerical data to character strings. SUMMARY OF THE INVENTION. The present invention relates to a method, system, and computer program product that convert a floating-point representation of a number to a character string quickly, efficiently, and accurately The inventive technique can be used by web servers in producing web pages and reports as well as by other software converting numerical data to character strings. Mantissa bits are extracted from the floating-point representation of a value into an integer format The mantissa bits of the integer format may be shifted left by a number of positions that is equal to a base 2 exponent of a firs t representation of the value Prior to converting the value, the floating-point representation of the value can be divided by 2 n where n is the number of the mantissa bits in the floating-point representation of the value A set of operations can then be performed to convert the result of the division to a number greater than or equal to 1 0 and less than 10 0 The set of operations may include multiplication operations and or retrieving a constant from a lookup table. In one embodiment, the set of operations comprises a lookup operation and a multiplication operation, where the lookup operation retrieves a constant from a lookup table, and the multiplication operation multiplies a current representation of the value by the constant The lookup table may further comprise a value of a base 10 exponent for a result of the multiplication operation. In another embodiment, the set of operations is a set of multiplication operations, and the set of multiplication operations includes no more than a maximum number of multiplication operations For example, if a number of bits in an exponent of the floating-point representation of the value is 11, the maximum number of multiplication operations is 9 For each multiplication operation, a corresponding value can be added to a variable that is used to calculate a base 10 exponent to be appended to the character string representing the value. BRIEF DESCRIPTION OF THE DRAWINGS. The present invention may be better understood, and its numerous objectives, features, and advantages made apparent to those skilled in the art by referencing the accompanying drawings. FIG 1 shows the components of a floating-point representation of a decimal number and its binary equivalent, as described above. FIG 2A shows a flowchart of a method for converting the floating-point representation of a number to a character string. FIG 2B shows a flowchart of one implementation of the Convert Real Number to Character String step of the flowchart of FIG 2A. FIG 3 shows an example of a conversion of a floating-point representation of a number to a character string in accordance with the steps of the flowchart of FIGS 2A and 2B. FIG 4 shows a flowchart of a method for converting the floating-point representation of a number to a character string in accordance with one embodiment of the invention. FIGS 5A and 5B show one possible implementation of the Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step of the flowchart of FIG 4 in accordance with one embodiment of the invention. FIG 6A shows an example of a conversion of a floating-point representation of a number to a character string in accordance with the steps of the flowcharts of FIGS 4, 5A and 5 B. FIG 6B shows another example of a conversion of a floating-point representation of a number to a character string in accordance with the steps of the flowcharts of FIGS 4, 5A and 5 B. FIG 7 illustrates rounding of floating point numbers using three fixed binary floating-poi nt numbers. FIG 8 shows one possible implementation of the Convert Integer to Character String step of FIG 4 in accordance with one embodiment of the invention. FIG 9 shows one possible implementation of the Round Integer step of FIG 8 in accordance with one embodiment of the invention. FIG 10A shows an example of converting an integer to a character string in accordance with the flowcharts of FIGS 8 and 9.FIG 10B shows another example of converting an integer to a character string in accordance with the flowcharts of FIGS 8 and 9.FIG 10C shows another example of converting an integer to a character string in accordance with the flowcharts of FIGS 8 and 9.The use of the same reference symbols in different drawings indicates similar or identical items. For a thorough understanding of the subject invention, refer to the following Detailed Description, including the appended Claims, in connection with the above-described Drawings Although the present invention is described in connection with several embodiments, the invention is not intended to be limited to the specific forms set forth herein On the contrary, it is intended to cover such alternatives, modifications, and equivalents as can be reasonably included within the scope of the invention as defined by the appended Claims. In the following description, for purposes of explanation, numerous specific details are set forth in order to provide a thorough understanding of the invention It will be apparent, however, to one skilled in the art that the invention can be practiced without these specific details. References in the specification to one embodiment or an embodiment means that a particular feature, structure, or characteristic described in connection with the embodiment is included in at least one embodiment of the invention The appearances of the phrase in one embodiment in various places in the specification are not necessarily all referring to the same embodiment, nor are separate or alternative embodiments mutua lly exclusive of other embodiments Moreover, various features are described which may be exhibited by some embodiments and not by others Similarly, various requirements are described which may be requirements for some embodiments but not other embodiments. The present invention can be used to quickly, efficiently, and accurately convert a value from a floating-point representation to a character string While the IEEE 754 8-byte format is used as an example of a floating-point representation of a number throughout this document, one of skill in the art will understand that the invention is not limited to the IEEE 754 8-byte format The techniques described herein can be applied to numbers represented in various other formats, including IEEE 754 4-byte format and IEEE 754 10-byte format Generally, any format representing a real number in the form of a fractional component and an exponent can be converted to a character string using the techniques described herein, with only slight adjustme nts to account for differences in the floating-point representation. FIG 2A shows a flowchart of a method for converting the floating-point representation of a number to a character string In Handle Sign Bit step 210 a value of zero indicates a positive number, and a value of one represents a negative number In Handle Special Cases e g Zero, Infinity, NaN step 220 values that have special representations in IEEE format are handled IEEE format reserves exponent fields of all 0s and all 1s to denote special values For example, if the exponent field has a zero and the fraction mantissa field has a zero, then zero is the intended value ignoring the assumed implicit leading bit 0 and 0 are therefore distinct values The values of infinity and infinity are denoted with an exponent of all 1s and a fraction of all 0s The sign bit distinguishes infinity and infinity Being able to define infinity as a special value is useful because it allows operations to continue past overflow situations where a number is too large or too small to be represented in floating-point format Operations with infinite values are well defined in IEEE floating-point representation The value NaN Not a Number is used to represent a value that is not a real number NaNs are represented by a bit pattern with an exponent of all 1s and a non-zero fraction. Control proceeds from Handle Special Cases e g Zero, Infinity, NaN step 220 to Convert Real Number to Character String step 230 Alternative implementations of this step are discussed below with reference to FIGS 2B and 4 From Convert Real Number to Character String step 230 control proceeds to Insert Decimal Point step 240 At Insert Decimal Point step 240 a decimal point is inserted into the character string For example, the decimal point can be inserted after the first character of the character string representing the number Control then proceeds to Handle Exponent step 250 For example, an e or other character indicative of an exponent and the exponent s value are appended to the character string representing the value One of skill in the art will understand that other ways of writing the number are possible. FIG 2B shows a flowchart of one implementation of the Convert Real Number to Character String step 230 of the flowchart of FIG 2A Control begins with Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 232 In this step, the value of the real number is manipulated so that only one digit precedes the decimal point Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 232 converts the real number to have a value between 1 0 inclusive and 10 0 exclusive. To convert the real number to have a value between 1 0 and 10 0, the decimal point can be moved left or right to produce only one digit preceding the decimal point In base 10, moving the decimal point to the right by one position is the equivalent of multiplying the current representation of the value by 10, whereas movin g the decimal point to the left by one position is the equivalent of dividing the current representation of the value by 10 or multiplying the current representation of the value by 0 1 This conversion will assure that one digit having a value between 1 and 9 precedes the decimal point, enabling conversion from each numerical digit to its character equivalent. Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 232 deals with normalizing the current representation of the real number, and therefore the number of multiplication operations is determined by the size of the exponent In some implementations, Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 232 may require up to 308 multiplication operations for example, conversion of the largest value 10 308 can be implemented using 308 multiplication operations, where each multiplication operation multiplies the current representation of the real number by 10 Such an implementation is very expensive, and a more efficient implementation of Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 232 is discussed with reference to FIGS 4, 5A and 5 B below. From Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 232 control proceeds to Convert Digit to Character step 234 Each digit has a character equivalent, so Convert Digit to Character step 234 converts the numeric digit to its character equivalent Control then proceeds to Last Digit decision point 236 If the digit is the last digit in the current representation of the real number, the real number has been converted to a character string and control returns to the flowchart of FIG 2A having completed Convert Real Number to Character String step 230.At Last Digit decision point 236 if the converted digit is not the last digit in the current representation of the real number, control proceeds to Eliminate Converted Digit from Current Representation of Real Number step 238 This step is discussed in further detail with reference to FIG 3 From Eliminate Converted Digit from Current Representation of Real Number step 238 control proceeds to Multiply Current Representation of Real Number by 10 step 239 to process additional digits in the current representation of the real number. The number of times tha t Multiply Current Representation of Real Number by 10 step 239 is executed and the number of multiplication operations that will occur is determined by the size of the mantissa The longest number that can be represented in the 52 mantissa bits of the IEEE standard 754 floating-point format contains 17 digits Consequently, the loop from Convert Digit to Character step 234 to Multiply Current Representation of Real Number by 10 step 239 may be executed up to 17 times These multiplication operations are in addition to the 308 operations that may be performed in Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 232 for a possible total of 325 multiplication operations. FIG 3 shows an example of a conversion of a floating-point representation of a number to a character string in accordance with the steps of the flowchart of FIG 2B In this figure, a real number having a value of 3 14159 is converted to a character string The table shows six iterations of t he loop shown in FIG 2B with each entry in the table representing a step number that is executed and the resulting values of the current representation of the real number or the character string as a result of executing the respective step In Convert Real Number to Character String step 230 of FIG 2A the processing shown in flowchart of FIG 2B begins At Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 232 the current representation of the number, 3 14159, has a value between 1 and 10, so no numerical calculation is performed in Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 232 as shown in the Comment column. In the flowchart of FIG 2B control proceeds from Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 232 to Convert Digit to Character step 234 As shown in FIG 3 the character equivalent of the leading digit in the current representation of the real number, 3, is placed int o the character string in the first position Because 3 is not the last digit of the real number at Last Digit decision point 236 control in the flowchart of FIG 2B passes to Eliminate Converted Digit from Current Representation of Real Number step 238 The digit corresponding to the character 3 is eliminated from the current representation of the real number, to provide a new current representation of the real number having a value of 0 14159 Control then proceeds to Multiply Current Representation of Real Number by 10 step 239 in the flowchart of FIG 2B. At Multiply Current Representation of Real Number by 10 step 239 the current representation of the real number has a value of 0 14159 The current representation of the real number is multiplied by 10 as shown in the Comment column , thereby moving the decimal point one position to the right and producing a new value for the current representation of the real number of 1 4159 Control then returns to Convert Digit to Character step 234 wh ere the leading digit, 1, is inserted into the character string Because 1 is not the last digit of the real number at Last Digit decision point 236 control proceeds to Eliminate Converted Digit from Current Representation of Real Number step 238 where the converted digit 1 is removed from the current representation of the real number, which now has a value of 0 4159.In the remaining third, fourth, fifth, and sixth iterations of the loop of FIG 2B each digit in the current representation of the real number is iteratively placed into the character string In addition, each respective remaining current representation of the real number is multiplied by 10 when control returns to Multiply Current Representation of Real Number by 10 step 239 Five multiplication operations are necessary to convert the mantissa 3 14159 to a character array having the characters 314159.When the last digit is processed, 9 in this example, the number has been converted a character string having contents 314159, a s shown in the last line of the table of FIG 3. Convert Real Number to Character String step 230 of FIG 2A is completed Control then proceeds to Insert Decimal Point step 240 and Handle Exponent step 250 of the flowchart of FIG 2A In Handle Exponent step 250 the result may be formatted for easier reading by not writing an exponent of zero, for example. FIG 4 shows a flowchart of a method for converting the floating-point representation of a number to a character string in accordance with one embodiment of the invention The flowchart of FIG 4 provides an alternative implementation of the method of FIG 2A for Convert Real Number to Integer step 230.In FIG 4 control begins at Initialize Variable for Base 10 Exponent step 410 Because the numerical value of the real number changes during the process of performing Convert Real Number to Integer step 230 the base 10 exponent of the number is adjusted accordingly In one embodiment of the invention, the base 10 exponent variable is initialized t o have a value of zero Control then proceeds to Adjust Real Number for Treatment as Integer step 420.In Adjust Real for Treatment as Integer step 420 operations can be performed that compensate for the effects of the subsequent Extract Mantissa Bits into Integer step 450 Normally, the mantissa bits of a floating-point representation are treated as a fractional portion of the value being represented, and not as an integer In one embodiment of the invention, Adjust Real Number for Treatment as Integer step 420 can be implemented by dividing the current representation of the value by 252 This division operation offsets the later extraction of the mantissa bits into an integer that occurs in Extract Mantissa Bits into Integer step 450 Extraction of the mantissa bits into an integer produces a result that would have been produced if the mantissa bits were multiplied by 252 For formats other than IEEE 754 8-byte format, similar adjustments may need to be made. From Adjust Real Number for Trea tment as Integer step 420 control proceeds to Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 In one embodiment of the invention, Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 can be implemented to provide a substantial improvement over the technique described with reference to FIG 2B As noted earlier, the technique described with reference to FIG 2B Multiply Current Representation of Real Number by 10 step 239 may perform one multiplication operation for each digit of the number being converted Instead, in the embodiment shown in FIG 4 a maximum number of multiplication operations are performed for example, for IEEE 754 8-byte format, a maximum of 9 multiplication operations are performed FIGS 5A and 5B show one possible implementation of Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440.Another possible implementation of Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 is to use a lookup table In one embodiment, a lookup table contains constants with values from 10 327 to 10 308 Each constant in the lookup table is a multiple of 10 or a multiple of 0 1 To convert the real number to have a value between 1 0 and 10 0, a single multiplication operation can be performed to produce the same result For example, if the current representation of the real number is between 10 243 and 10 244 inclusive , the constant 10 244 can be retrieved from the lookup table The current representation of the real number can be multiplied by the constant 10 244 which effectively moves the decimal point 244 places to the right in the base 10 representation of the number As a result, the current representation of the real number is between 1 0 and 10 0.From Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 control proceeds to Extract Mantissa Bits into Integer step 450 In one embodiment, the mantissa bits are extracted into a 64-bit integer format As mentioned previously, normally the mantissa bits of a floating-point representation are treated as a fractional portion of the value being represented, and not as an integer For a number represented in IEEE standard 754 floating-point format, extracting the mantissa bits into an integer format operates as if an implicit decimal point were moved from the beginning of the mantissa to the end Extracting the mantissa bits into an integer format has the effect of multiplying by 2 52 In addition, extracting the mantissa bits into an integer explicitly places the implicit 1 of the mantissa as the first left-most digit of the integer. As described above, to counteract this effect, Adjust Real Number for Treatment as an Integer step 430 was previously performed For example, the adjustment to the value in Adjust Real Number for Treatment as an Integer step 430 can be implemented by dividing the current representation of the real num ber by 2 52 which offsets the subsequent effect of multiplying by 2 52 which is the effect of extracting the mantissa bits into an integer For formats other than IEEE 754 8-byte format, similar adjustments may need to be made. From Extract Mantissa Bits into Integer step 450 control proceeds to Adjust Mantissa Bits step 460 The calculations performed thus far have ensured that the current representation of the real number has a leading digit between 1 and 9 in base 10 format The equivalent base 2 representation of the numerical leading digit therefore has a value between 1 2 0 and 9 2 3 1 , so that the unbiased value of the base 2 exponent is 0, 1, 2, or 3 To accurately represent the value in the integer format, the mantissa bits of IEEE standard 754 floating-point format can be adjusted by multiplying by the appropriate value, either 2 0 one, which has no effect , 2 1 2 2 or 2 3 Multiplication by 2 1 2 2 or 2 3 can be accomplished by shifting the mantissa bits to the left by, respectiv ely, 1, 2, or 3 positions. After Adjust Mantissa Bits step 460 the bits in the integer representation of the value are accurate Control proceeds to Convert Integer to Character String step 470 where the digits in the integer are converted to a character string In one embodiment, an additional process may be used at this point to round the integer so that the resulting rounded integer is converted to the shortest possible character string that accurately represents the value of the real number This rounding algorithm is discussed in further detail with reference to FIG 8 The conversion from integer format to character string format can be performed, for example, by readily available integer-to-character conversion functions One example of such an integer-to-character conversion function is the i64toa function of the C programming language, which converts a 64-bit integer to a character format and is available in various commercially-available run-time libraries. After Convert Integer to C haracter String step 470 the string contains the character values equivalent to the decimal representation of the value, with an implicit decimal point at the end of the character string To place the value into normalized form, the implicit decimal point may be moved, for example, from the end of the character string to the first position after the first character in the character string To reflect this change, the base 10 exponent is adjusted in Adjust Base 10 Exponent step 480 For example, if the character string has 14 characters, the decimal point is moved from the end of the character string by 13 positions to the left, with the result that the decimal point is positioned after the first character The numerical value of the base 10 exponent is adjusted to reflect this change To reflect movement of the decimal point by 13 positions to the left, a value of 13 is added to the base 10 exponent. From Adjust Base 10 Exponent step 480 control proceeds to Trim Trailing Zeroes from Characte r String step 490 where any trailing zeroes are trimmed from the end of the character string Control then returns to the flowchart of FIG 2A having completed the Convert Real Number to Integer step 230 Control then proceeds to Insert Decimal Point step 240 and Handle Exponent step 250 In one embodiment, an e and the value of the base 10 exponent are appended to the character string Other refinements may be made For example, if the base 10 exponent is 0, the e and the value of 0 may not be printed at all For small exponents, the decimal point may be repositioned for example, 6 225e1 may be printed simply as 62 25 Various other manipulations of the format of the value are within the scope of the invention. FIGS 5A and 5B show one implementation of the Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 of FIG 4 FIG 5A is used when the current representation of the real number has a value greater than or equal to 10 0 and must be decreased to fall betw een 1 0 inclusive and 10 0 exclusive FIG 5B is used when the current representation of the real number has a value less than 1 0.In FIG 5A an initial decision is made in Current Representation of Real Number 10 0 decision point 502 If the real number has a value that is 10 0 or greater, control proceeds to i 8 step 504 If the real number does not have a value that is 10 0 or greater, control proceeds to step 516 of the flowchart shown in FIG 5B. In FIG 5A at i 8 step 504 a counter i is initialized to have a value of 8 The reason that the counter i is initialized to 8 is explained in further detail below At Current Representation of Real Number 10 2 i decision point 506 a comparison is made of the size of the current representation of the real number with 10 raised to an exponent, where the exponent itself is a power of 2 Recall that 10 308 is the largest integer that can be represented in IEEE 754 8-byte format To convert the current representation of the real number to have a value bet ween 1 0 and 10 0, the current representation of the real number is manipulated by either multiplying or dividing by 10 raised to a power of 2 10 2 8 10 256 is the largest number less than or equal to 10 308 with an exponent that is a power of 2 Consequently, i is initially set to 8.At Current Representation of Real Number 10 2 i , decision point 506 if the current representation of the real number is greater than or equal to 10 2 i control proceeds to Multiply Current Representation of Real Number by 10 2 i step 508 where the current representation of the real number is decreased in size by multiplying the current representation of the real number by 10 2 i which is equivalent to dividing the current representation of the real number by 10 2 i Control then proceeds to Add 2 i to the Base 10 Exponent Variable step 510 where the exponent is increased to compensate for the smaller value of the current representation of the real number Control then proceeds to i i 1 step 512 where the val ue of the counter i is decremented in preparation for the next iteration of the loop Control proceeds to i 0 decision point 514 where a determination is made whether the counter i has a value less than 0, indicating that conversion of the current representation of the real number to a value between 1 0 and 10 0 is complete At i 0 decision point 514 if i has a value less than 0, Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 of FIG 4 is complete If i is not less than 0, control returns to Current Representation of Real Number 10 2 i decision point 506 to compare using a new value of i in the exponent. During iterations of the loop shown in FIG 5A up to 9 multiplication operations are performed These 9 multiplication operations include successively multiplying a current representation of the real number by a multiple of 0 1, thereby gradually decreasing the value of the current representation of the real number to a value between 1 0 inclusive an d 10 0 exclusive Note that each multiple of 0 1 is of the form 10 2 i for values of i from 0 through 8 For each multiplication operation, a corresponding adjustment is made to the base 10 exponent of the value to properly position the decimal point For example, if the value is multiplied by 10 8 then a value of 8 is added to the base 10 exponent, reflecting the fact that the value of the current representation of the number is smaller by 10 8.As noted previously, FIGS 5A and 5B show one implementation of the Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 of FIG 4 FIG 5B is used when the current representation of the real number has a value less than 1 0 and must be increased to fall between 1 0 and 10 0.In FIG 5B an initial decision is made in Current Representation of Real Number 1 0 decision point 516 If the real number has a value that is less than 1 0, control proceeds to i 8 step 518 If the real number does not have a value that is less t han 1 0, processing in FIG 5B is complete. In FIG 5B at i 8 step 518 a counter i is initialized to have a value of 8 At Current Representation of Real Number 10 2 i 1 decision point 520 a comparison is made of the size of the current representation of the real number with 10 raised to an exponent, where the exponent itself is a negative power of 2 minus one If the current representation of the real number is less than 10 2 i 1 control proceeds to Multiply Current Representation of Real Number by 10 2 i step 522 where the current representation of the real number is increased in size by multiplying the current representation of the real number by 10 2 i Control then proceeds to Add 2 i to the Base 10 Exponent Variable step 524 where the exponent is decreased to compensate for the larger value of the current representation of the real number Control then proceeds to i i 1 step 526 where the value of the counter i is decremented in preparation for the next iteration of the loop Control pro ceeds to i 0 decision point 528 where a determination is made whether the counter i has a value less than 0, indicating that conversion of the current representation of the real number to a value between 1 0 and 10 0 is complete At i 0 decision point 528 if i has a value less than 0, Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 of FIG 4 is complete If i is not less than 0, control returns to Current Representation of Real Number 10 2 i 1 decision point 520 to compare using a new value of i in the exponent. During iterations of the loop shown in FIG 5B up to 9 multiplication operations are performed These 9 multiplication operations include successively multiplying a current representation of the real number by a multiple of 10 For example, in IEEE 754 8-byte format, if the value 1 0, each successive operation multiplies a current representation of the value by one of the following multiples of 10 10 256 10 128 10 64 10 32 10 16 10 8 10 4 10 2 or 10 1 These multiplication operations thereby gradually increase the value of the current representation of the real number to a value between 1 0 and 10 0 Note that each multiple of 10 is of the form 10 2 i for values of i from 0 through 8 For each multiplication operation, a corresponding adjustment is made to the base 10 exponent of the value to properly position the decimal point For example, if the value is multiplied by 10 8 then a value of 8 is added to the base 10 exponent in other words, a value of 8 is subtracted from the base 10 exponent, reflecting the fact that the value of the current representation of the number is larger by 10 8.FIG 6A shows an example of a conversion of a floating-point representation of a number to a character string in accordance with the steps of the flowcharts of FIGS 4, 5A and 5 B The number being converted in this example is the decimal number 62 25 Initially, the number has a value of 6 225 10 1 as shown in the base 10 mantissa and exponent f ields The number has a binary value of 1 1111001 2 5 as shown in the base 2 mantissa and exponent fields Note that the implicit leading 1 is shown in the base 2 column of the table A base 10 variable is initialized to have a value of zero, as described with reference to Initialize Variable for Base 10 Exponent step 410.Control then proceeds to Adjust Real Number for Treatment as Integer step 420 of FIG 4 As described above, this step involves dividing the current representation of the value by 2 52 This division operation changes the base 2 exponent from 5 to 47 The result of the division operation in base 10 is 1 3822276656 10 14 as shown in the base 10 mantissa and exponent columns. Control then proceeds to Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 This step is described with reference to the flowchart of FIG 5B Recall that FIG 5B is used when the current representation of the real number has a value less than 1 0 and must be increased t o fall between 1 0 and 10 0.In FIG 5B an initial decision is made in Current Representation of Real Number 1 0 decision point 516 The real number 1 3822276656 10 14 has a value that is less than 1 0, so control proceeds to i 8 step 518 At Current Representation of Real Number 10 2 i 1 decision point 520 a comparison is made of the size of the current representation of the real number with 10 raised to an exponent, where the exponent itself is a negative power of 2 minus one In the example shown, the value of 1 3822276656 10 14 is not less than 10 2 i 1 until i 3, as shown in the next row of the table When i 3, 1 3822276656 10 14 is less than 10 2 i 1 10 7 At that point, the current representation of the real number is less than 10 2 i 1 so control proceeds to Multiply Current Representation of Real Number by 10 2 i step 522 where the current representation of the real number is increased in size by multiplying the current representation of the real number by 10 2 i 10 8 producing a bas e 10 result of 1 3822276656 10 6 as shown in the base 10 mantissa and exponent columns of the table Note that the base 2 number also changes as a result of the multiplication, producing a result of 1 0111 2 20 as shown in the base 2 mantissa and exponent columns of the table. Control then proceeds to Add 2 i to the Base 10 Exponent Variable step 524 where the base 10 exponent variable is decreased by a value of 8 to compensate for the larger value of the current representation of the real number, producing a base 10 exponent variable with a value of 8 Control then proceeds to i i 1 step 526 where the value of the counter i is decremented in preparation for the next iteration of the loop Control proceeds to i 0 decision point 528 where a determination is made whether the counter i has a value less than 0, indicating that conversion of the current representation of the real number to a value between 1 0 and 10 0 is complete At i 0 decision point 528 i now has a value of 2, so control retu rns to Current Representation of Real Number 10 2 i 1 decision point 520 to compare using a value of i 2 in the exponent. During iterations of the loop shown in FIG 6A three multiplication operations are performed These three multiplication operations include successively multiplying a current representation of the real number by a multiple of 10, in this case 10 8 10 4 and 10 2 These multiplication operations thereby gradually increase the value of the current representation of the real number to a value between 1 0 and 10 0 For each multiplication operation, a corresponding adjustment is made to the base 10 exponent of the value to properly position the decimal point For example, when the value is multiplied by 10 8 then a value of 8 is added to the base 10 exponent in other words, a value of 8 is subtracted from the base 10 exponent, reflecting the fact that the value of the current representation of the number is larger by 10 8.Upon completion of three iterations of the loop, the cu rrent base 10 representation of the value is 1 3822276656 10 0 which is a value between 1 and 10 The base 2 equivalent is 1 011 2 0 as shown in the last row of the table for step 440 The base 10 variable has a value of 14 Processing of Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 of FIG 4 is complete Control then proceeds to Extract Mantissa Bits into Integer step 450 of FIG 4.In Extract Mantissa Bits into Integer step 450 of FIG 4 the mantissa of the base 10 number is extracted into a 64-bit integer Recall that the implicit leading one is shown in the base 2 number column of the previous table Extracting the mantissa with the leading one produces the 64-bit integer shown Note that the extraction has the effect of moving the decimal point from after the implicit leading one to the end of the integer, or of moving the decimal point 52 places to the right i e this is the same effect as multiplying the value by 2 52 As described earlier, in Adj ust Real Number for Treatment as Integer step 420 the current representation of the value was divided by 2 52 in preparation for this effect Control proceeds to Adjust Mantissa Bits step 460 where the mantissa bits are adjusted to reflect the base 2 exponent The current base 2 exponent is 0, as shown in the table, so no adjustment is made at this step Control then proceeds to Convert Integer to Character String step 470 The resulting string has a value of 6225000000000000 A character is used to show a leading blank appended to the character string Control then proceeds to Adjust Base 10 Exponent step 480 where the base 10 exponent is adjusted to account for moving the implicit decimal point from the end of the character string 6225000000000000 to the left by 15 spaces thereby effectively dividing the integer value by 10 15 which is compensated by adding 15 to the base 10 exponent, changing the value from 14 to 1.After completion of Adjust Base 10 Exponent step 480 the character equival ent of the real number has been determined Control then proceeds to Trim Trailing Zeroes from Character String step 490 where trailing zeroes are trimmed from the character string to produce the shortest possible character string These trailing zeroes appear after the decimal point and therefore have no effect on the value or the base 10 exponent After Trim Trailing Zeroes from Character String step 490 control returns to Insert Decimal Point step 240 of FIG 2 where a decimal point is inserted into the character string In this example, the leftmost blank represented by is moved to a position after the first non-zero digit, and then the blank space is changed to a decimal point Control proceeds to Handle Exponent step 250 of FIG 2 where an e and the base 10 variable value of 1 are appended to the character string The result is a character string having the value 6 225e1 One of skill in the art will understand that this value may be formatted differently for printing, but the value is th e character equivalent of the real number 62 25.FIG 6B shows another example of a conversion of a floating-point representation of a number to a character string in accordance with the steps of the flowcharts of FIGS 4, 5A and 5 B The number being converted in this example is the decimal number 41 625 Initially, the number has a value of 4 1625 10 1 as shown in the base 10 mantissa and exponent fields The number has a binary value of 1 01001101 2 5 as shown in the base 2 mantissa and exponent fields A base 10 variable is initialized to have a value of zero, as described with reference to Initialize Variable for Base 10 Exponent step 410.Control then proceeds to Adjust Real Number for Treatment as Integer step 420 of FIG 4 As described above, this step involves dividing the current representation of the value by 2 52 This division operation changes the base 2 exponent from 5 to 47 The result of the division operation in base 10 is 9 242606 10 15 as shown in the base 10 mantissa and expo nent columns. The first table of FIG 6B shows four iterations of Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 As shown in the step column of the table, these iterations are for i having values of 3, 2, 1, and 0 Upon completion of four iterations of the loop, the current base 10 representation of the value is 9 242606 10 15 which is a value between 1 and 10 The base 2 equivalent is 1 001 2 3 as shown in the last row of the table for step 440 The base 10 variable has a value of 15 Processing of Convert Current Representation of Real Number to have Value between 1 0 and 10 0 step 440 of FIG 4 is complete Control then proceeds to Extract Mantissa Bits into Integer step 450 of FIG 4.In Extract Mantissa Bits into Integer step 450 of FIG 4 the mantissa of the base 2 number is extracted into a 64-bit integer, as shown in the second table Control proceeds to Adjust Mantissa Bits step 460 where the mantissa bits are adjusted to reflect the base 2 expon ent The current base 2 exponent is 3, as shown in the first table, so three zeros are appended at the end of the 64-bit integer Control then proceeds to Convert Integer to Character String step 470 The resulting string has a value of 41625000000000000 A character is used to show a leading blank appended to the character string Control then proceeds to Adjust Base 10 Exponent step 480 where the base 10 exponent is adjusted to account for moving the implicit decimal point from the end of the character string 41625000000000000 to the left by 16 spaces thereby dividing the integer value by 10 16 which is compensated by adding 16 to the base 10 exponent, changing the value from 15 to 1.After completion of Adjust Base 10 Exponent step 480 the character equivalent of the real number has been determined Control proceeds to Trim Trailing Zeroes from Character String step 490 where the trailing zeroes are trimmed to produce a character string of 41625 Control returns to Insert Decimal Point step 240 of FIG 2 where a decimal point is inserted into the character string In this example, the leftmost blank represented by is moved to a position after the first non-zero digit, and then the blank space is changed to a decimal point Control proceeds to Handle Exponent step 250 of FIG 2 where an e and the base 10 variable value of 1 are appended to the character string The result is a character string having the value 4 1625e1 One of skill in the art will understand that this value may be formatted differently for printing, but the value is the character equivalent of the real number 41 625.One issue related to formatting and printing floating-point numbers is conciseness As shown in the examples above, each binary floating-point number is represented as a fixed number of bits or bytes An infinite number of strings can accurately represent a single binary floating-point number because the binary floating-point number has a fixed number of bits and the string can have an infinite numbe r of characters, at least theoretically Even when taking into account the fact that computer memory is finite, many different character strings can be used to represent a single binary floating-point number having a fixed number of bits or bytes. FIG 7 illustrates rounding of floating point numbers using three fixed binary floating-point numbers A binary representation 710 B of each number is shown, along with a decimal representation 710 D of the number The numbers are next to each other in sequence, such that only the least significant bits change Because of the limited number of bits, no fixed binary floating-point number can be represented between the numbers. These three numbers are shown on a real number line 720 in FIG 7 Because of the fixed number of bits, none of the real numbers between these points can be uniquely represented Thus, real numbers between two adjacent values must be rounded to the nearest floating-point number One way to round the real number is to take the mid-p oint between two floating-point numbers Real numbers falling between those two mid-points are rounded to the same binary floating-point number Thus, the real numbers that fall within the segment 732 between the two mid-points on real number line 730 are rounded to 01 The IEEE 754 specification provides a specification for rounding the mid-points. The real numbers in segment 732 of real number line 730 show that one binary floating-point number can represent an infinite number of real numbers Each real number can be represented as a string of characters thus, each binary floating-point number can be represented as an infinite number of strings When formatting the real number for presentation, it is preferable to choose the shortest character string from the infinite number of possible character strings. FIG 8 is a flowchart for determining the shortest character string to represent a floating point number in accordance with one embodiment of the invention As noted above, this process may be used as one implementation of Convert Integer to Character String step 470 of FIG 4 to determine the shortest possible string that accurately represents the value of the floating point number The conversion from the floating point value to an integer can be performed by performing steps 410 through 460 of the flowchart of FIG 4.When converting the resulting integer to a character string, the implementation of Convert Integer to Character String 470 can include the method shown in FIG 8 To determine the number of digits that the value can be rounded, the algorithm calculates mid-points between two pairs of the three numbers similar to the two mid-points related to segment 732 of FIG 7 The least significant digits are rounded, keeping the desired number between the two mid-points The desired number is then converted to a character string using a standard integer-to-character conversion function as described above with reference to Convert Integer to Character String step 470 of FIG 4. The floating-point number to be converted is stored in a floating-point variable named Value and in an integer format named IValue The rounding process begins in Calculate Upper and Lower Adjacent Floating Point Values step 810 where the immediately adjacent floating point values are calculated Calculation of the Lower value can be performed by subtracting 1 from the mantissa bits for Value The Upper value can be calculated by adding 1 to the mantissa bits for Value Overflow and underflow conditions should be addressed when adding or subtracting values from the mantissa bits For example, if the mantissa bits are all 0s zeroes , the exponent should be adjusted to avoid mantissa underflow If the mantissa bits are all 1s, the exponent should be adjusted to avoid mantissa overflow. Control proceeds from Calculate Upper and Lower Adjacent Floating Point Values step 810 to Convert Upper and Lower to Integers step 820 At this point, steps 410 through 460 of the flowchart of FIG 4 can be used t o convert Upper and Lower to integers The integer forms of Value, Upper, and Lower are referred to herein as IValue, IUpper, and ILower Control then proceeds to Calculate Mid-points step 830 An IMidUpper mid-point between IUpper and IValue is calculated as IUpper IValue 2 Value The value of IValue is added to avoid potential overflow An IMidLower mid-point between ILower and IValue is calculated as UValue ILower 2 ILower. From Calculate Mid-points step 830 to Round Integer step 840 Round Integer step 440 is discussed in further detail with reference to FIG 9 Control proceeds from Round Integer step 840 to Convert Rounded Integer to Character String step 850 The rounded integer is then converted to a character string using a standard integer-to-character conversion function as described above with reference to Convert Integer to Character String step 470 of FIG 4 At this point, Convert Integer to Character String 470 of FIG 4 is complete, and control returns to Adjust Base 10 Exponent st ep 480 of FIG 4.FIG 9 shows one possible implementation of the Round Integer step 840 of FIG 8 in accordance with one embodiment of the invention At Divisor Initial Value e g 10,000 step 910 a divisor is set to an initial value In this example, the divisor is set to 10,000 Control proceeds to Divisor 1 decision point 920 where a determination is made whether the divisor now has a value of 1 Having just assigned a value of 10,000 to the divisor, the result of the determination at Divisor 1 decision point 920 is no, and control proceeds to IMod IValue Modulus Divisor step 930 IMod IValue Modulus Divisor step 930 places the result of IValue Modulus Divisor into the IMod variable The modulus function divides the number by the divisor and returns the remainder from the division operation. From IMod IValue Modulus Divisor step 930 control proceeds to IValue Divisor IMod IMidUpper step 940 IValue Divisor IMod IMidUpper step 940 determines whether the difference between IValue and Divisor IMod is less than the variable IMidUpper, which would indicate IValue can be rounded up If so, control proceeds to IValue IValue Divisor IMod step 950 where Ivalue is rounded by incrementing IValue by Divisor IMod Control then proceeds to Return Rounded Integer IValue for Conversion to Character String step 990 Processing of Round Integer step 840 of FIG 8 is then complete, and control returns to Convert Rounded Integer to Character String step 850 where the rounded value of IValue is converted to a character string At that point, processing of Convert Integer to Character String step 470 of FIG 4 is completed, and control returns to Adjust Base 10 Exponent step 480 of FIG 4.Referring again to FIG 9 at IValue Divisor IMod IMidUpper step 940 if the difference between IValue and Divisor IMod is not less than the variable IMidUpper, control proceeds to IValue IMod IMidLower step 970 If IValue IMod IMidLower step 970 indicates that IValue IMod is greater than the value of IMidLower, IValue can be rounded down Control proceeds to IValue IValue IMod step 960 where IValue is decreased by the amount of IMod Control then proceeds to Return Rounded Integer IValue for Conversion to Character String step 990 Processing of Round Integer step 840 of FIG 8 is then complete, and control returns to Convert Rounded Integer to Character String step 850 where the rounded value of IValue is converted to a character string At that point, processing of Convert Integer to Character String step 470 of FIG 4 is completed, and control returns to Adjust Base 10 Exponent step 480 of FIG 4.Referring again to FIG 9 at IValue IMod IMidLower step 970 if the difference between IValue and IMod is not greater than the value if IMidLower, rounding the current value of IValue would not produce the shortest possible character string Control proceeds to Divisor Divisor 10 step 980 The divisor is divided by 10, and control returns to Divisor 1 decision point 920 where the value of the divisor is tested If the v alue of the divisor is 1, control proceeds to Return Rounded Integer IValue for Conversion to Character String step 990 Processing of Round Integer step 840 of FIG 8 is then complete, and control returns to Convert Rounded Integer to Character String step 850 where the rounded value of IValue is converted to a character string At that point, processing of Convert Integer to Character String step 470 of FIG 4 is completed, and control returns to Adjust Base 10 Exponent step 480 of FIG 4.In the algorithm presented in FIG 8 three floating-point numbers are converted into 64-bit integers in order to find each mid-point This process can be reduced by calculating only integer values for Lower, ILower and IMidLower A value of the upper mid-point can be calculated as IMidUpper IValue IValue IMidLower Mantissa overflow and underflow conditions must be taken into consideration when calculating the upper mid-point. An alternative solution is to use a look up table that has the delta IValue IMidLow er already calculated Boundary cases can be handled by dividing or multiplying the delta by 2 The look-up table would contain one entry for each possible base-2 exponent value For conversion of 8-byte floating-point numbers, the look-up table would have 2,048 entries Each entry in the table would be represented by 2 bytes, so the look-up table would require 4 KB of memory. FIG 10A shows an example of converting an integer to a character string in accordance with the flowcharts of FIGS 8 and 9 Each calculation will be described with reference to the steps of the flowcharts of FIGS 8 and 9 The initial value of 41 625 is the value to be converted At Calculate Upper and Lower Adjacent Floating Point Values step 810 the values shown in table 10 A - 1 Lower and Upper columns are calculated Control then proceeds to Convert Upper and Lower to Integers step 820 which are represented by IUpper and ILower columns of the first row in Table 10 A - 2 At this point, steps 410 through 460 of the flowchar t of FIG 4 can be used to convert Upper and Lower to integers Control then proceeds to Calculate Mid-points step 830 and the results are shown in the IMidLower and IMidUpper columns of the second row of Table 10 A - 2 As described above, the IMidUpper mid-point between IUpper and IValue is calculated as IUpper IValue 2 IValue The value of IValue is added to avoid potential overflow The IMidLower mid-point between ILower and IValue is calculated as IValue ILower 2 ILower. From Calculate Mid-points step 830 control proceeds to Round Integer step 840 This step is represented by Table 10 A - 3 The first row corresponds to Divisor Initial Value e g 10,000 step 910 where the Divisor variable is set to 10,000 Control proceeds to Divisor 1 decision point 920 where a determination is made whether the divisor now has a value of 1 Having just assigned a value of 10,000 to the divisor, the result of the determination at Divisor 1 decision point 920 is no, and control proceeds to IMod IValue Modulus D ivisor step 930 As shown in the second row of Table 10 A - 3 IMod is assigned the result of IValue Modulus Divisor in this case 0 In this row, the modulus function divides the number 41625000000000000 by the divisor 10,000 and returns the remainder 0 from the division operation. From IMod IValue Modulus Divisor step 930 control proceeds to IValue Divisor IMod IMidUpper step 940 IValue Divisor IMod IMidUpper step 940 determines whether the difference between IValue and Divisor IMod is less than the variable IMidUpper, which would indicate IValue can be rounded up At IValue Divisor IMod IMidUpper step 940 the difference between IValue and Divisor IMod is not less than the variable IMidUpper, so control proceeds to IValue IMod IMidLower step 970 IValue IMod IMidLower step 970 indicates that IValue IMod is greater than the value of IMidLower, so that IValue can be rounded down In this example, IValue IMod is greater than the value of IMidLower, so control proceeds to IValue IValue IMod step 960 where IValue is decreased by the amount of IMod which is zero in this case Control then proceeds to Return Rounded Integer IValue for Conversion to Character String step 990 The value returned is the value of IValue, 41625000000000000 However, because the last twelve characters are trailing zeroes, those characters will be trimmed in Trim Trailing Zeroes from Character String step 490 of FIG 4 Therefore, the shortest character string will actually be 41625.FIG 10B shows another example of converting an integer to a character string in accordance with the flowcharts of FIGS 8 and 9 The initial value of 0 1499999999999999944 is the value to be converted At Calculate Upper and Lower Adjacent Floating Point Values step 810 the values shown in table 10 B - 1 Lower and Upper columns are calculated Control then proceeds to Convert Upper and Lower to Integers step 820 which are represented by IUpper and ILower columns of the first row in Table 10 B - 2 At this point, steps 410 through 460 of the flowchart of FIG 4 can be used to convert Upper and Lower to integers Control then proceeds to Calculate Mid-points step 830 and the results are shown in the IMidLower and IMidUpper columns of the second row of Table 10 B - 2 As described above, the IMidUpper mid-point between IUpper and IValue is calculated as IUpper IValue 2 IValue The value of IValue is added to avoid potential overflow The IMidLower mid-point between ILower and IValue is calculated as IValue ILower 2 ILower. From Calculate Mid-points step 830 control proceeds to Round Integer step 840 This step is represented by Table 10 B - 3 The first row corresponds to Divisor Initial Value e g 10,000 step 910 where the Divisor variable is set to 10,000 Control proceeds to Divisor 1 decision point 920 where a determination is made whether the divisor now has a value of 1 Having just assigned a value of 10,000 to the divisor, the result of the determination at Divisor 1 decision point 920 is no, and control proceeds to IMod IVa lue Modulus Divisor step 930 As shown in the second row of Table 10 A - 3 IMod is assigned the result of IValue Modulus Divisor in this case 9,944 In this row, the modulus function divides the number 1499999999999999944 by the divisor 10,000 and returns the remainder 9,944 from the division operation. From IMod IValue Modulus Divisor step 930 control proceeds to IValue Divisor IMod IMidUpper step 940 IValue Divisor IMod IMidUpper step 940 determines whether the difference between IValue and Divisor IMod is less than the variable IMidUpper, which would indicate IValue can be rounded up In this example, the difference between IValue and Divisor IMod is less than the variable IMidUpper, so control proceeds to IValue IValue Divisor IMod step 950 At IValue IValue Divisor IMod step 950 IValue is rounded by incrementing IValue by Divisor IMod , producing a value of 1500000000000000000 Control then proceeds to Return Rounded Integer IValue for Conversion to Character String step 990 Processing o f Round Integer step 840 of FIG 8 is then complete, and control returns to Convert Rounded Integer to Character String step 850 where the rounded value of IValue is converted to a character string At that point, processing of Convert Integer to Character String step 470 of FIG 4 is completed, and control returns to Adjust Base 10 Exponent step 480 of FIG 4 The character string will be trimmed to 15 when the trailing zeroes are trimmed in Trim Trailing Zeroes from Character String step 490 of FIG 4.FIG 10C shows another example of converting an integer to a character string in accordance with the flowcharts of FIGS 8 and 9 The initial value of 1 02099847614441939e-130 is the value to be converted At Calculate Upper and Lower Adjacent Floating Point Values step 810 the values shown in table 10 C - 1 Lower and Upper columns are calculated Control then proceeds to Convert Upper and Lower to Integers step 820 which are represented by IUpper and ILower columns of the first row in Table 10 C - 2 At this point, steps 410 through 460 of the flowchart of FIG 4 can be used to convert Upper and Lower to integers Control then proceeds to Calculate Mid-points step 830 and the results are shown in the IMidLower and IMidUpper columns of the second row of Table 10 C - 2 As described above, the IMidUpper mid-point between IUpper and IValue is calculated as IUpper IValue 2 IValue The value of IValue is added to avoid potential overflow The IMidLower mid-point between ILower and IValue is calculated as IValue ILower 2 ILower. From Calculate Mid-points step 830 control proceeds to Round Integer step 840 This step is represented by Table 10 C - 3 The first row corresponds to Divisor Initial Value e g 10,000 step 910 where the Divisor variable is set to 10,000 Control proceeds to Divisor 1 decision point 920 where a determination is made whether the divisor now has a value of 1 Having just assigned a value of 10,000 to the divisor, the result of the determination at Divisor 1 decision point 92 0 is no, and control proceeds to IMod IValue Modulus Divisor step 930 As shown in the second row of Table 10 C - 3 IMod is assigned the modulus Divisor of IValue in this case 1,939 In this row, the modulus function divides the number 1 02099847614441939e-130 by the divisor 10,000 and returns the remainder 1,939 from the division operation. From IMod IValue Modulus Divisor step 930 control proceeds to IValue Divisor IMod IMidUpper step 940 IValue Divisor IMod IMidUpper step 940 determines whether the difference between IValue and Divisor IMod is less than the variable IMidUpper, which would indicate IValue can be rounded up In this example, the difference between IValue and Divisor IMod is not less than the variable IMidUpper, so control proceeds to IValue IMod IMidLower step 970 At IValue IMod IMidLower step 970 IValue IMod is not greater than the value of IMidLower, so control proceeds to Divisor Divisor 10 step 980 where the divisor is divided by 10 Control then returns to Divisor 1 de cision point 920 where a determination is made whether the divisor has reached a value of 1 At this point, the divisor has a value of 1000, as shown in the third row of Table 10 C - 3.The fourth through the eighth rows of Table 10 C - 3 show that rounding is not possible and the divisor is reduced in multiple iterations of Divisor Divisor 10 step 980 At the eighth row, the difference between IValue and Divisor IMod is less than the variable IMidUpper, so control proceeds to IValue IValue Divisor IMod step 950 At IValue IValue Divisor IMod step 950 IValue is rounded by incrementing IValue by Divisor IMod , producing a value of 102099847614441940 Control then proceeds to Return Rounded Integer IValue for Conversion to Character String step 990 Processing of Round Integer step 840 of FIG 8 is then complete, and control returns to Convert Rounded Integer to Character String step 850 where the rounded value of IValue is converted to a character string At that point, processing of Convert Inte ger to Character String step 470 of FIG 4 is completed, and control returns to Adjust Base 10 Exponent step 480 of FIG 4 The character string will be trimmed to 10209984761444194 when the trailing zeroes are trimmed in Trim Trailing Zeroes from Character String step 490 of FIG 4.The present invention has many advantages By significantly reducing the number of multiplication operations in converting a real number from a floating point representation to a character string, the conversion can be performed more quickly, thereby increasing the speed of conversion The process can be used by web servers, increasing the throughput of web servers, as well as by other software performing conversion of real numbers to character strings The shortest possible character string that accurately represents the value can be produced, thereby making reports and screen displays easier to read and improving customer satisfaction. The present invention is well adapted to attain the advantages mentioned as we ll as others inherent therein While the present invention has been depicted, described, and is defined by reference to particular embodiments of the invention, such references do not imply a limitation on the invention, and no such limitation is to be inferred The invention is capable of considerable modification, alteration, and equivalents in form and function, as will occur to those ordinarily skilled in the pertinent arts The depicted and described embodiments are examples only, and are not exhaustive of the scope of the invention. The foregoing detailed description has set forth various embodiments of the present invention via the use of block diagrams, flowcharts, and examples It will be understood by those within the art that each block diagram component, flowchart step, operation and or component illustrated by the use of examples can be implemented, individually and or collectively, by a wide range of hardware, software, firmware, or any combination thereof. The present inventio n has been described in the context of fully functional computer systems however, those skilled in the art will appreciate that the present invention is capable of being distributed as a program product in a variety of forms, and that the present invention applies equally regardless of the particular type of signal bearing media used to actually carry out the distribution Examples of signal bearing media include recordable media such as floppy disks and CD-ROM, transmission type media such as digital and analog communications links, as well as media storage and distribution systems developed in the future. The above-discussed embodiments may be implemented by software modules that perform certain tasks The software modules discussed herein may include script, batch, or other executable files The software modules may be stored on a machine-readable or computer-readable storage medium such as a disk drive Storage devices used for storing software modules in accordance with an embodiment o f the invention may be magnetic floppy disks, hard disks, or optical discs such as CD-ROMs or CD-Rs, for example A storage device used for storing firmware or hardware modules in accordance with an embodiment of the invention may also include a semiconductor-based memory, which may be permanently, removably or remotely coupled to a microprocessor memory system Thus, the modules may be stored within a computer system memory to configure the computer system to perform the functions of the module Other new and various types of computer-readable storage media may be used to store the modules discussed herein. The above description is intended to be illustrative of the invention and should not be taken to be limiting Other embodiments within the scope of the present invention are possible Those skilled in the art will readily implement the steps necessary to provide the structures and the methods disclosed herein, and will understand that the process parameters and sequence of steps are give n by way of example only and can be varied to achieve the desired structure as well as modifications that are within the scope of the invention Variations and modifications of the embodiments disclosed herein can be made based on the description set forth herein, without departing from the scope of the invention Consequently, the invention is intended to be limited only by the scope of the appended claims, giving full cognizance to equivalents in all respects. Binary Calculator. Ingin menghitung dengan operan desimal Anda harus mengkonversinya terlebih dulu. Tentang Kalkulator Biner. Ini adalah kalkulator biner presisi sewenang-wenang. Hal ini dapat menambah penggumpalan mengalikan atau membagi dua bilangan biner. Ia dapat beroperasi pada bilangan bulat sangat besar dan nilai fraksional yang sangat kecil dan kombinasi dari Kedua kalkulator ini, dengan desain, sangat sederhana Anda bisa menggunakannya untuk mengeksplorasi bilangan biner dalam bentuknya yang paling dasar. Ini beroperasi pada bilangan biner murni, bukan format angka komputer seperti pelengkap dua soket atau floating point IEEE. Bagaimana Menggunakannya Kalkulator Biner. Masukkan satu operan di setiap kotak. Setiap operan harus bilangan positif atau negatif tanpa koma atau spasi, tidak dinyatakan sebagai pecahan, dan tidak dalam notasi ilmiah Nilai pecahan ditunjukkan dengan titik radix, bukan, dan angka negatif. Diawali dengan tanda minus. Pilih sebuah operasi. Atur jumlah bit yang Anda inginkan ditampilkan dalam hasil biner, jika berbeda dari default, ini hanya berlaku untuk pembagian, dan hanya dengan w Jika jawabannya memiliki bagian pecahan yang tak terhingga. Klik Hitung untuk melakukan operasi. Klik Hapus untuk mereset formulir dan mulai dari nol. Jika Anda ingin mengubah operan, cukup ketik di atas nomor asli dan klik Hitung tidak perlu klik. Bersihkan terlebih dahulu Demikian pula, Anda dapat mengubah operator dan menjaga operan sebagaimana adanya. Terlepas dari hasil operasi, jumlah digit di operan dan hasilnya ditampilkan. Misalnya, saat menghitung 1 1101 111 100011 1101 1010110111, Num Digit Box display 1 4 3 6 4 10 Ini berarti bahwa operan 1 memiliki satu digit di bagian integer dan empat digit pada bagian pecahannya, operan 2 memiliki tiga digit pada bagian integer dan enam digit pada bagian pecahannya, dan hasilnya memiliki empat Digit di bagian integer dan sepuluh digit pada bagian pecahannya. Tambahan, pengurangan, dan perkalian selalu menghasilkan hasil yang terbatas, namun pembagian pada kenyataannya, dalam banyak kasus menghasilkan nilai pecahan berulang yang tak terbatas. Hasil yang tak terbatas adalah Terpotong tidak dibulatkan ke jumlah bit yang ditentukan Hasil tak terbatas dicatat dengan elipsis ditambahkan ke hasilnya, dan dengan simbol sebagai jumlah pecahan digit Untuk divisi yang mewakili fraksi diadik hasilnya akan terbatas dan ditampilkan dengan presisi penuh terlepas dari Pengaturan untuk jumlah bit pecahan. Misalnya, 1 1010 sampai 24 bit pecahan adalah 0 000110011001100110011001, dengan Num Digits 1 0 4 0 0 11 100 0 11, dengan Num Digits 2 0 3 0 0 2.Menggunakan Kalkulator untuk Mengeksplorasi Floating Aritmatika Aritmatika Meskipun kalkulator ini menggunakan aritmatika biner murni, Anda dapat menggunakannya untuk mengeksplorasi aritmatika floating-point Misalnya, katakanlah Anda ingin tahu mengapa, dengan menggunakan aritmatika bilangan biner floating-point IEEE dua kali lipat, 129 95 10 1299 5, tapi 129 95 100 12994 999999999998181010596454143524169921875. Ada dua sumber ketidaktepatan dalam perhitungan desimal seperti konversi floating-point dan aritmatika biner presisi terbatas Desimal floating-point conv Ersion memperkenalkan inexactness karena operan desimal mungkin tidak memiliki floating-point equivalent-precision binary arithmetic yang tepat mengenalkan inexactness karena perhitungan biner dapat menghasilkan lebih banyak bit daripada yang dapat disimpan. Dalam kasus ini, pembulatan terjadi.10 dan 100 kedua desimal memiliki floating yang tepat. - masing-masing setara 1010 dan 1100100, tapi 129 95 hanya memiliki perkiraan representasi desimal ke konverter biner saya akan mengatakan bahwa, dalam biner murni, 129 95 memiliki fraksi berulang yang tak terbatas.10000001 111100110011001100110011001100110011001100110 011.Ditemukan pada 53 bit ganda - pengujian, itu adalah 129809999999998863131622783839702606201171875 dalam desimal.129 95 10 dihitung as. which sama dengan 10100010011 01111111111111111111111111111111111111111111 1. Ini adalah 54 bit signifikan panjangnya, jadi jika dibulatkan menjadi 53 bit maka menjadi 1.29 95 100 dihitung sebagai . Yang sama dengan 11001011000010 11111111111111111111111111111111111111111 011. Ini adalah 56 bit signifikan lo ng, so when it s rounded to 53 bits it becomes. which equals 12994 999999999998181010596454143524169921875.To work through this example, you had to act like a computer, as tedious as that was First, you had to convert the operands to binary, rounding them if necessary then, you had to multiply them, and round the result. For practical reasons, the size of the inputs and the number of fractional bits in an infinite division result is limited If you exceed these limits, you will get an error message But within these limits, all results will be accurate in the case of division, results are accurate through the truncated bit position.

No comments:

Post a Comment