本文介绍了数字除以零是硬件异常的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在C ++异常处理期间了解到,数字除以零是硬件异常。谁能解释为什么它被称为硬件异常

I have learnt during C++ exceptional handling that number divide by zero is a hardware exception. Can anybody explain it why it is called hardware exception

推荐答案

因为它不是C ++的异常。通常,在C ++世界中,我们使用硬件陷阱一词来避免任何歧义,但也可以使用硬件例外。基本上,硬件触发了一些操作,这些操作会导致您进入操作系统。

Because it is not an exception in the C++ sense. Usually, in the C++ world, we use the word "hardware trap", to avoid any ambiguity, but "hardware exception" can also be used. Basically, the hardware triggers something which will cause you to land in the OS.

并不是所有的系统都会生成除以0的硬件陷阱。结果就是您只获得了最大可能的价值,并持续下去。

And not all systems will generate a hardware trap for divide by 0. I've worked on one where you just got the largest possible value as a result, and kept on.

这篇关于数字除以零是硬件异常的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-15 11:10