lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


> > Changing L to LL has no effect in this case. Also interesting is that
> > in my test matrix of {VS2010, VS2012, VS2013} x {x86, x64}, only
> > VS2010 x86 exhibits the wrong behaviour. Said wrong behaviour seems to
> > be caused by a call to the CRT's _ftol2 routine, which nominally
> > converts from floating point to integer - I would initially guess that
> > either _ftol2 is at fault for not handling large numbers properly, or
> > the compiler is at fault for generating code to call the wrong
> > conversion routine.
> 
> Many thanks for the tests. Knowing that VS2012/2013 handle it correctly
> gives some comfort. (My Windows virtual machine has exactly the
> "bad" combination VS2012-x86).

At least in the documentation, VS2013 still does it wrong; it still
explicitly recognizes the bug :-(

  http://msdn.microsoft.com/en-us/library/d3d6fhea%28v=vs.120%29.aspx

  Conversions from float, double, or long double values to unsigned
  long are not accurate if the value being converted is larger than the
  maximum positive long value.

(And this is not related to C99...)

-- Roberto