联盟首页 协同开发 共创软件 开放源码 软件工程 共创论坛 关于联盟
  您的位置 » 开放源码库【成熟 - 项目摘要 首页 | 分类源码 | 提交源码 | 下载统计 | 原创源码 | 成熟源码 | 代码片断
 
 Base Number Conversion Routines - 项目摘要
摘要 | 管理 | 论坛
文档 | 软件包

源码库中源码数量为18996
有贡献人员名单:

-= 更多 =-
  • ffdshow
  • jasperreports
  • Air Traffic Controller
  • PoolMan
  • virtualdub-win
  • Apache-SSL-Jserv
  • CppUnit
  • GLgraph
  • FCK editor
  • Async Professional
  • -= 更多 =-

    项目描述:
    Here are two routines that will take any decimal number and convert it to any number base between 2 and 36 and vice-versa. The first routine, ConvertDecToBaseN, takes the decimal number and the base to convert it to as parameters. If no base is supplied, then base 16 (hexadecmial) is assumed. The original author of this routine is Peter Rodriguez. I got his code from www.devx.com - it was a "Tip of the Day". In his tip, he encouraged the reader to derive a partner function that would bring his converted number back to base 10. So I accepted his challenge and wrote the second routine, ConvertBaseNToDec, which is modeled after his routine and takes the converted number and converted number's base as parameters and returns the decimal equivalent. If no base is supplied, then base 16 is assumed.

    这儿有两个例程,可将任何一个十进制小数转换为2和36进制之间的任何一个数,反之亦然。第一个例程,ConvertDecToBaseN,获得一个十进制小数和基数并将它按参数转换。如果没有提供基数,就会假定基数为16(hexadecmial)。这个例程的原作者是Peter Rodriguez。我在www.devx.com上获得他的代码-它是一个"Tip of the Day"程序。他在他的叙述中鼓励读者派生一个函数,将他被转换的数字还原为基数是10的数字。我接受他的挑战,编写出了第二个例程,ConvertBaseNToDec,是对他的程序进行的模仿,获得被转换的数字及数字的基数作为参数,然后将之还原为对等的数字。 如果没有提供基数,就会假定基数为16(hexadecmial)。
    来源: http://www.codeguru.com/vb_misc/2137.shtml
    类别:
    发布者: cbd002

    最新发布源码包
    软件包 版本号 日期 本地下载
    2137_convert  1.1  2004-03-07 下载

    原始下载连接(国外) http://www.codeguru.com/vb_misc/2137_convert.zip
    http://www.codeguru.com/code/legacy/vb_misc/2137_convert.zip

      » 合 作 伙 伴