生成世界末日的数字 [英] generation of Apocalyptic number

查看:74
本文介绍了生成世界末日的数字的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Hi Group,


我想知道如何存储2个生成的数字到

150的功率

即pow(2,150);


主要是我想知道怎样才能获得价值大的

数字.... !


因为这超过了所有的数据类型限制........


任何人都可以告诉我解决方案吗?或c代码执行此操作

打印它。


欢呼

R

解决方案

Rajshekhar写道:


小组,


我喜欢我知道怎样才能存储一个由2

产生的数字到150的功率


主要是我想知道如何才能获得价值的大量功能

a数.... ....


因为这超过了所有的数据类型限制.. ......


可以告诉我解决方案吗?或c代码执行此操作

将打印它。



使用大号库。


如果二进制文件适合您,您可以非常轻松地打印它:


char _149zeros [150];

int i;

for(i = 0; i< 149; + + i){

_149zeros [i] =''0'';

}

_149zeros [149] =''\ 0 '';

printf(" b%c%s",''1'',_149zeros);


;-)


不,真的,你要找的是一个库来处理

任意大数字。谷歌为它,有很多

吧。


Wolfgang Draxinger

-

电子邮件地址有效,Jabber: he******@jabber.org ,ICQ:134682867


9月23日,2:47 * pm,Wolfgang Draxinger< wdraxin ... @ darkstargames.de>

写道:


Rajshekhar写道:


Hi Group,


我想知道如何存储一个由2

产生的数字到150的功率
即pow(2,150);


主要是我想知道怎样才能得到一个数字的大值

一个数字......!


因为这超过了所有数据类型限制........


可以告诉我解决方案吗?或c代码执行此操作

将打印它。



使用大号库。


如果二进制文件适合您,您可以非常轻松地打印它:


char _149zeros [150];

int i;

for(i = 0; i< 149; + + i){

* * * * _149zeros [i] =''0'';}


_149zeros [149] =''\ 0 '';

printf(" b%c%s",''1'',_149zeros);


;-)


不,真的,你要找的是一个库来处理

任意大数字。谷歌为它,有很多

吧。


Wolfgang Draxinger

-

电子邮件地址有效,Jabber:hexar ... @ jabber.org,ICQ:134682867






感谢您的回复


"包含数字666(即

野兽数)的数字2 ^ n称为世界末日数。是一个世界末日的

数。

前几个这样的权力是157,192,218,220 ......&#


所以检查号码是否有666首先我必须存储

号码?


这正是我想要的

希望你得到我想说的内容..!


欢呼


Rajshekhar写道:


嗨组,


我想知道怎样才能存储2中生成的数字到

功率为150

即功率(2,150);


主要是我想知道如何才能获得一个大功率的价值$>
数字....!


因为这超过了所有的数据类型限制........


可以任何人告诉我解决方案吗?或c代码执行此操作

打印它。


欢呼

R



如果您使用lcc-win编译器,您可以:

#include< qfloat.h>

#include< stdio.h>

int main(无效)

{

qfloat s = pow(2.0q,150.0q);


printf("%50.2qf \ n",s);

返回0;

}


输出:


1427247692705959881058285969449495136382746624.00

您可以在下面的地址下载lcc-win:


-

jacob navia

jacob at jacob point remcomp point fr

logiciels / informatique
http://www.cs.virginia.edu/~lcc-win32


Hi Group,

I woud like to know how can i store a number generated out of 2 to
power of 150
i.e pow(2,150);

mainly i want to knw how can i get the value a large powers of a
number....!

since this crosses all the data type limits ........

can any one tell me the solution ? or c code to do this which will
print it.

cheers
R

解决方案

Rajshekhar wrote:

Hi Group,

I woud like to know how can i store a number generated out of 2
to power of 150
i.e pow(2,150);

mainly i want to knw how can i get the value a large powers of
a number....!

since this crosses all the data type limits ........

can any one tell me the solution ? or c code to do this which
will print it.

Use a big number library.

You can print it very easily by the way, if binary is ok for you:

char _149zeros[150];
int i;
for(i = 0; i < 149; ++i) {
_149zeros[i] = ''0'';
}
_149zeros[149] = ''\0'';
printf("b%c%s", ''1'', _149zeros);

;-)

No really, what you''re looking for is a library to deal with
arbitrary large numbers. Google for it, there are plenty of
them.

Wolfgang Draxinger
--
E-Mail address works, Jabber: he******@jabber.org, ICQ: 134682867


On Sep 23, 2:47*pm, Wolfgang Draxinger <wdraxin...@darkstargames.de>
wrote:

Rajshekhar wrote:

Hi Group,

I woud like to know how can i store a number generated out of 2
to power of 150
i.e pow(2,150);

mainly i want to knw how can i get the value a large powers of
a number....!

since this crosses all the data type limits ........

can any one tell me the solution ? or c code to do this which
will print it.


Use a big number library.

You can print it very easily by the way, if binary is ok for you:

char _149zeros[150];
int i;
for(i = 0; i < 149; ++i) {
* * * * _149zeros[i] = ''0'';}

_149zeros[149] = ''\0'';
printf("b%c%s", ''1'', _149zeros);

;-)

No really, what you''re looking for is a library to deal with
arbitrary large numbers. Google for it, there are plenty of
them.

Wolfgang Draxinger
--
E-Mail address works, Jabber: hexar...@jabber.org, ICQ: 134682867

Hi,

Thanks for the reply

"A number of the form 2^n that contains the digits 666 (i.e., the
beast number) is called an apocalyptic number. is an apocalyptic
number.
The first few such powers are 157, 192, 218, 220, ..."

so to check whether the number has 666 or not first i have to have the
number stored ??

thats exactly what i want
hope u got what i am trying to say..!

cheers


Rajshekhar wrote:

Hi Group,

I woud like to know how can i store a number generated out of 2 to
power of 150
i.e pow(2,150);

mainly i want to knw how can i get the value a large powers of a
number....!

since this crosses all the data type limits ........

can any one tell me the solution ? or c code to do this which will
print it.

cheers
R

If you use the lcc-win compiler you do:
#include <qfloat.h>
#include <stdio.h>
int main(void)
{
qfloat s = pow(2.0q,150.0q);

printf("%50.2qf\n",s);
return 0;
}

Output:

1427247692705959881058285969449495136382746624.00

You can download lcc-win at the address below:

--
jacob navia
jacob at jacob point remcomp point fr
logiciels/informatique
http://www.cs.virginia.edu/~lcc-win32


这篇关于生成世界末日的数字的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆