Re: [dev] dwm-5.6

From: Szabolcs Nagy <nszabolcs_AT_gmail.com>
Date: Fri, 17 Jul 2009 19:51:47 +0200

On 7/17/09, Preben Randhol <randhol_AT_pvv.org> wrote:
> (float)*w/(float)*h != (float) (w/h) in most cases also...

this expression won't even compile: dereference is only allowed for
pointers division for numbers

if you meant
(float)w/h != (float)(w/h)
with int w,h, then you are right, the former is floating point
division the later one is integer
but this is totally unrelated to the problem i was describing

my problem was that it seems that c and ieee754 does not even require
that the arithmetic operations are well defined: same operation on
same numbers with same type does not necessary give the same result
(even on same architecture with same compiler)

for example
(double)atoi("1")/atoi("3") == (double)atoi("1")/atoi("3")
gives false with gcc on my x86 machine eventhough the two expressions
are semantically equivalent
Received on Fri Jul 17 2009 - 17:51:47 UTC

This archive was generated by hypermail 2.2.0 : Fri Jul 17 2009 - 18:00:01 UTC