:: Re: [DNG] Studying C as told. (For …
Etusivu
Poista viesti
Vastaa
Lähettäjä: Irrwahn
Päiväys:  
Vastaanottaja: dng
Aihe: Re: [DNG] Studying C as told. (For help)
On Fri, 24 Jun 2016 22:36:33 +0100, Katolaz wrote:
> On Fri, Jun 24, 2016 at 09:44:31PM +0200, Irrwahn wrote:
>> On Fri, 24 Jun 2016 19:41:54 +0100, Rainer Weikusat wrote:
>> [...]
>>> If you want
>>> a mathematical example, picture somone always writing
>>>
>>> x / (1/n)
>>>
>>> instead of
>>>
>>> x * n
>>
>> Not to undermine your point, just a minor quibble: The example
>> is flawed in that above terms are not quite equivalent, as they
>> differ in their respective domain of definition.
>>
>
> ..... not considering the fact that if n happens to be an integer, the
> first expression almost always raises a floating point exception
> (Division by zero), unless n==1... :)


Well, AIUI it was supposed to be a mathematical example, not a
code snippet, but apart from that — yes, indeed. Of course unless
x happens to be of floating point type, and n != 0. But then the
results for n < -1 or n > 1 would presumably come as a surprise
to a considerable number of people. :)

Regards
Urban
--
DNG - we split your hairs at the subatomic scale. 8^)