如何检查(浮点)数字是否为阿姆斯壮. [英] How to check whether a (floating point) number is Armstrong or not.

查看:108
本文介绍了如何检查(浮点)数字是否为阿姆斯壮.的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个问题要检查输入的浮点数是否为Armstrong(请参阅Wikipedia上的Armstrong数字定义 [^ ]).
请尽快给我答复.....

I have problem that i want to check enter floating point number is Armstrong or not (see Armstrong number definition on Wikipedia[^]).
Please answer me as soon as possible.....

推荐答案

尝试一下:):
Try it :) :
{
  BOOL bARM(FALSE);
#ifdef _ARM_
  bARM = TRUE;
#endif // ifdef _ARM_
...
}


您是否听说过

鉴于您所指出的定义,浮点数"自恋数字正好为零.所有已知的88个以10为底的自恋数字都是整数.

看看这个概念背后的数学原理,这很容易测试.但是,由于Long Integers的限制,您将需要一个BigInteger库来处理最大的肯定标识案例.
Given the definition you pointed out, there are precisely zero "floating point" narcissistic numbers. All of the known 88 base 10 narcissistic numbers are integers.

Looking at the math behind this concept, this is ridiculously easy to test for. Though, due to the limitations of Long Integers, you''ll need a BigInteger library to handle the largest cases of a positive identification.


这篇关于如何检查(浮点)数字是否为阿姆斯壮.的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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