On Thursday, 18 January 2018 at 16:31:02 UTC, ag0aep6g wrote:
I'm interpreting that to mean that it will become an error for
some time, but later it will be allowed again with the new
behavior. And then you can throw away `-transition=intpromote`.
Seeing as it's almost 3 years later, I'd like
On Thursday, 18 January 2018 at 18:00:51 UTC, rumbu wrote:
On Thursday, 18 January 2018 at 17:54:59 UTC, rumbu wrote:
On Thursday, 18 January 2018 at 12:51:48 UTC, Dominikus Dittes
target = isNegative ? cast(Unsigned!T)(-c) :
cast(Unsigned!T)c;
That would have been better even before the
On Thursday, 18 January 2018 at 17:54:59 UTC, rumbu wrote:
On Thursday, 18 January 2018 at 12:51:48 UTC, Dominikus Dittes
target = isNegative ? cast(Unsigned!T)(-c) : cast(Unsigned!T)c;
That would have been better even before the change, because
the operator '-' used on unsigned types is
On Thursday, 18 January 2018 at 12:51:48 UTC, Dominikus Dittes
Scherkl wrote:
On Thursday, 18 January 2018 at 06:05:08 UTC, rumbu wrote:
On Thursday, 18 January 2018 at 02:30:17 UTC, Rubn wrote:
On Wednesday, 17 January 2018 at 22:30:11 UTC, rumbu wrote:
code like "m = n < 0 ? -n : n" doesn't
On 01/18/2018 05:22 PM, Steven Schveighoffer wrote:
Sure, but what does the statement "Once deprecated this will become an
error" mean? Will I have to use the -transition=intpromote switch
forever to avoid an error?
As you quoted before: "Once deprecated this will become an error, and
then
On 1/18/18 11:14 AM, ag0aep6g wrote:
On 01/18/2018 03:30 PM, Steven Schveighoffer wrote:
Is there going to be a point where casts aren't needed? Otherwise,
this is pretty ugly.
You don't need casts when you use `-transition=intpromote`.
Sure, but what does the statement "Once deprecated
On 01/18/2018 03:30 PM, Steven Schveighoffer wrote:
Is there going to be a point where casts aren't needed? Otherwise, this
is pretty ugly.
You don't need casts when you use `-transition=intpromote`.
On 1/17/18 2:40 PM, rumbu wrote:
This started in the last DMD version (2.078):
byte b = -10;
ulong u = b < 0 ? -b : b;
//Deprecation: integral promotion not done for `-b`, use
'-transition=intpromote' switch or `-cast(int)(b)
Why do I need a to promote a byte to int to obtain an ulong? Even
On Thursday, 18 January 2018 at 06:05:08 UTC, rumbu wrote:
On Thursday, 18 January 2018 at 02:30:17 UTC, Rubn wrote:
On Wednesday, 17 January 2018 at 22:30:11 UTC, rumbu wrote:
code like "m = n < 0 ? -n : n" doesn't worth a wrapper
That code is worth a wrapper, it's called "abs"...
m =
On Thursday, 18 January 2018 at 02:30:17 UTC, Rubn wrote:
On Wednesday, 17 January 2018 at 22:30:11 UTC, rumbu wrote:
code like "m = n < 0 ? -n : n" doesn't worth a wrapper
That code is worth a wrapper, it's called "abs"...
m = abs(n);
Well, since I'm in the learn forum and you seem to
On Wednesday, 17 January 2018 at 22:30:11 UTC, rumbu wrote:
code like "m = n < 0 ? -n : n" doesn't worth a wrapper
That code is worth a wrapper, it's called "abs"...
m = abs(n);
On 01/17/2018 11:30 PM, rumbu wrote:
1. Why do I need explicitely to promote my byte to int in order to
assign it to an ulong?
2.077: ulong u = -b; 2.088: ulong u = -cast(int)b;
Those two snippets are not equivalent.
When b = byte.min, the 2.077 snippet gives u = 18446744073709551488,
while
On 01/17/2018 02:30 PM, rumbu wrote:
> 1. Why do I need explicitely to promote my byte to int in order to
> assign it to an ulong?
> 2.077: ulong u = -b; 2.088: ulong u = -cast(int)b;
You're not assigning your byte to ulong; you're assigning the expression
-b to ulong. -b is discovered to have
On Wednesday, 17 January 2018 at 21:12:07 UTC, Rubn wrote:
On Wednesday, 17 January 2018 at 20:30:07 UTC, rumbu wrote:
And here is why is bothering me:
auto max = isNegative ? cast(Unsigned!T)(-T.min) :
cast(Unsigned!T)T.max);
The generic code above (which worked for all signed integral
On Wednesday, 17 January 2018 at 20:30:07 UTC, rumbu wrote:
And here is why is bothering me:
auto max = isNegative ? cast(Unsigned!T)(-T.min) :
cast(Unsigned!T)T.max);
The generic code above (which worked for all signed integral
types T in 2.077) must be rewritten like this in 2.078:
On 01/17/2018 09:30 PM, rumbu wrote:
And here is why is bothering me:
auto max = isNegative ? cast(Unsigned!T)(-T.min) : cast(Unsigned!T)T.max);
The generic code above (which worked for all signed integral types T in
2.077) must be rewritten like this in 2.078:
static if (T.sizeof >= 4)
On Wednesday, 17 January 2018 at 20:30:07 UTC, rumbu wrote:
And here is why is bothering me:
auto max = isNegative ? cast(Unsigned!T)(-T.min) :
cast(Unsigned!T)T.max);
The generic code above (which worked for all signed integral
types T in 2.077) must be rewritten like this in 2.078:
And here is why is bothering me:
auto max = isNegative ? cast(Unsigned!T)(-T.min) :
cast(Unsigned!T)T.max);
The generic code above (which worked for all signed integral
types T in 2.077) must be rewritten like this in 2.078:
static if (T.sizeof >= 4)
auto max = isNegative ?
On Wednesday, 17 January 2018 at 19:54:50 UTC, ag0aep6g wrote:
On 01/17/2018 08:40 PM, rumbu wrote:
This started in the last DMD version (2.078):
byte b = -10;
ulong u = b < 0 ? -b : b;
//Deprecation: integral promotion not done for `-b`, use
'-transition=intpromote' switch or `-cast(int)(b)
On 01/17/2018 08:40 PM, rumbu wrote:
This started in the last DMD version (2.078):
byte b = -10;
ulong u = b < 0 ? -b : b;
//Deprecation: integral promotion not done for `-b`, use
'-transition=intpromote' switch or `-cast(int)(b)
Why do I need a to promote a byte to int to obtain an ulong?
20 matches
Mail list logo