Closed GoogleCodeExporter closed 9 years ago
Actually, the error message is correct - "float" is currently aliased based on
sizeof(int) in the C++ compiler. For most 64 bit compilers, sizeof(int) is
still, paradoxically, 32 bit. We may want to reconsider this and alias float
based on sizeof(float) in the compiler, though that's also 32 bit on the only
64 bit compiler I have handy right now.
The reason you're getting that error is because uint is aliased to uint32 and
uint32 won't implicitly convert to float32 because doing so can result in
precision loss. But it can convert to float64, so the expression "i*PI" ends
up using "float64 * float64", which of course returns float64.
This is certainly unintuitive, though, and it adds weight to the argument for
relaxing the restrictions on implicit conversions.
the expression "val=float(i)*PI" will work.
Original comment by mind...@gmail.com
on 30 Oct 2010 at 3:56
Per discussion on the mailing list, we'll deal with this in Issue 9 when we
create real int/uint/float types
Original comment by mind...@gmail.com
on 2 Nov 2010 at 2:41
Original issue reported on code.google.com by
Conrad.S...@gmail.com
on 29 Oct 2010 at 11:31