On Tue, 11 Oct 2011, Carsten Haitzler (The Rasterman) wrote:

> On Tue, 11 Oct 2011 08:14:47 +0200 (CEST) Vincent Torri <vto...@univ-evry.fr>
> said:
>
>>
>>
>> On Mon, 10 Oct 2011, Enlightenment SVN wrote:
>>
>>> Log:
>>> use lround() for map coord rounding to avoid silly things like
>>>  15.999999999999999998 rounding down to 15... whihc leads to
>>>  sometimes... odd off-by-1 expected results.
>>
>> lround is C99 compliant and does not exist on Windows.
>>
>> why not using the macro
>>
>> #define round(x) (x<0?ceil((x)-0.5):floor((x)+0.5))
>
> because 1. i dont have a manual page for what is NOT supported in windows's 
> dev
> envs (that's why we have you!).

in google : "msdn the_function"

Also, did you read the man page of lround ?

See

http://linux.die.net/man/3/lround

did you read the line "Compile with -std=c99" ? Is that flag passed to the 
compiler ? Note that i added an m4 macro that checks if a flags is 
supported by the compiler

  2. floor and ceil return doubles, not
> integers. lround returns a long int (long).

so (long)ceil(15.999999999999999) does not return 16 ?

> why not do it that way? less efficient than a single lround call. and
> technically incorrect. i'm literally trying to solve minuscule rounding issues
> here and returning a rounded double could still return an inaccurate (by a 
> very
> tiny margin) double that will still get rounded the wrong way. :( need a call
> that rounds and returns an integer type (int, long, etc.) not a double or 
> float.

The, at least, check the availability in configure.ac

then

#ifndef HAVE_LROUND
# define lround ****
#endif

Vincent

------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
enlightenment-devel mailing list
enlightenment-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/enlightenment-devel

Reply via email to