[nem-bug] [Nemerle 0000962]: Primitives implicit conversation.
feedback at nemerle.org
feedback at nemerle.org
Thu Mar 1 17:41:36 CET 2007
A NOTE has been added to this issue.
======================================================================
<http://nemerle.org/bugs/view.php?id=962>
======================================================================
Reported By: iae
Assigned To:
======================================================================
Project: Nemerle
Issue ID: 962
Category: The Language
Reproducibility: always
Severity: minor
Priority: normal
Status: new
======================================================================
Date Submitted: 02-28-2007 07:21 CET
Last Modified: 03-01-2007 17:41 CET
======================================================================
Summary: Primitives implicit conversation.
Description:
According to C# specification:
13.1.2 Implicit numeric conversions
The implicit numeric conversions are:
• From sbyte to short, int, long, float, double, or decimal.
• From byte to short, ushort, int, uint, long, ulong, float, double, or
decimal.
• From short to int, long, float, double, or decimal.
• From ushort to int, uint, long, ulong, float, double, or decimal.
• From int to long, float, double, or decimal.
• From uint to long, ulong, float, double, or decimal.
• From long to float, double, or decimal.
• From ulong to float, double, or decimal.
• From char to ushort, int, uint, long, ulong, float, double, or decimal.
• From float to double.
Conversions from int, uint, long or ulong to float and from long or ulong
to double can cause a
loss of precision, but will never cause a loss of magnitude. The other
implicit numeric conversions never
lose any information.
There are no implicit conversions to the char type, so values of the other
integral types do not automatically
convert to the char type.
char should have implicit conversations to ushort, int, uint, long, ulong,
float, double. I think Nemerle should have same behaviour.
Question: why all implicit conversations to decimal is not provided?
Patch is attached.
======================================================================
----------------------------------------------------------------------
nikov - 02-28-07 10:36
----------------------------------------------------------------------
Did you mean 'conversion' instead of 'conversation'?
----------------------------------------------------------------------
nikov - 02-28-07 10:44
----------------------------------------------------------------------
IMO, conversion (long -> float) should not be implicit, because it may
cause a loss of precision.
This is design flaw in C#.
----------------------------------------------------------------------
iae - 03-01-07 17:41
----------------------------------------------------------------------
> Did you mean 'conversion' instead of 'conversation'?
Yep!
>IMO, conversion (long -> float) should not be implicit, because it may
cause a loss of precision.
>This is design flaw in C#.
Disagree. When I operate with non-integer numbers I expect non-integer
result. So, I don't need point compiler on this especial.
Issue History
Date Modified Username Field Change
======================================================================
02-28-07 07:21 iae New Issue
02-28-07 07:21 iae File Added: char_implicit.patch
02-28-07 10:36 nikov Note Added: 0001796
02-28-07 10:40 nikov Note Added: 0001797
02-28-07 10:43 nikov Note Edited: 0001797
02-28-07 10:44 nikov Note Edited: 0001797
02-28-07 10:44 nikov Note Edited: 0001797
03-01-07 17:41 iae Note Added: 0001798
======================================================================
More information about the bugs
mailing list