Brian Goetz
Date: Wednesday, 25 May 2022 at 17:18
To: Raffaello Giulietti ,
core-libs-dev@openjdk.java.net
Subject: Re: RFR: 8279986: methods Math::asXExact for safely checked primitive
casts
Another way to evaluate answers here is: are we inventing new relations, or
merely clarifying old ones
s-dev@openjdk.java.net
*Subject: *Re: RFR: 8279986: methods Math::asXExact for safely checked
primitive casts
This work is quite timely as we are now paving the way for primitive
type patterns over in Project Amber, and also has a nontrivial
connection with Valhalla. If you'll pard
Themotivation behind this PR isnot driven by pattern matching:John
Rose (the reporter of the JBS issue) is concerned about having safer
casts that, in addition, can be JITted to efficient code.
Yes, of course. But also, as the platform evolves, it often happens
that the same issues arise
-libs-dev@openjdk.java.net
Subject: Re: RFR: 8279986: methods Math::asXExact for safely checked primitive
casts
This work is quite timely as we are now paving the way for primitive
type patterns over in Project Amber, and also has a nontrivial
connection with Valhalla. If you'll pardon a
> Add a family of "safe" cast methods.
Raffaello Giulietti has updated the pull request incrementally with one
additional commit since the last revision:
8279986: methods Math::asXExact for safely checked primitive casts
-
Changes:
- all: https://git.openjdk.java.net/jdk/pull/8
This work is quite timely as we are now paving the way for primitive
type patterns over in Project Amber, and also has a nontrivial
connection with Valhalla. If you'll pardon a brief digression...
Instanceof and casting work together in a familiar way: before you cast,
you first ask instanceo
> Add a family of "safe" cast methods.
Raffaello Giulietti has updated the pull request incrementally with one
additional commit since the last revision:
8279986: methods Math::asXExact for safely checked primitive casts
-
Changes:
- all: https://git.openjdk.java.net/jdk/pull/8
On Mon, 23 May 2022 18:37:26 GMT, Raffaello Giulietti
wrote:
>> Add a family of "safe" cast methods.
>
> Raffaello Giulietti has updated the pull request incrementally with one
> additional commit since the last revision:
>
> 8279986: methods Math::asXExact for safely checked primitive casts
> Add a family of "safe" cast methods.
Raffaello Giulietti has updated the pull request incrementally with one
additional commit since the last revision:
8279986: methods Math::asXExact for safely checked primitive casts
-
Changes:
- all: https://git.openjdk.java.net/jdk/pull/8
On Tue, 10 May 2022 13:47:35 GMT, Raffaello Giulietti
wrote:
>> Add a family of "safe" cast methods.
>
> Raffaello Giulietti has updated the pull request incrementally with one
> additional commit since the last revision:
>
> 8279986: methods Math::asXExact for safely checked primitive casts
> Add a family of "safe" cast methods.
Raffaello Giulietti has updated the pull request incrementally with one
additional commit since the last revision:
8279986: methods Math::asXExact for safely checked primitive casts
-
Changes:
- all: https://git.openjdk.java.net/jdk/pull/8
On Tue, 10 May 2022 04:42:19 GMT, Joe Darcy wrote:
>> Raffaello Giulietti has updated the pull request with a new target base due
>> to a merge or a rebase. The incremental webrev excludes the unrelated
>> changes brought in by the merge/rebase. The pull request contains four
>> additional com
On Mon, 9 May 2022 09:26:58 GMT, Raffaello Giulietti
wrote:
>> Add a family of "safe" cast methods.
>
> Raffaello Giulietti has updated the pull request with a new target base due
> to a merge or a rebase. The incremental webrev excludes the unrelated changes
> brought in by the merge/rebase.
On Mon, 9 May 2022 09:26:58 GMT, Raffaello Giulietti
wrote:
>> Add a family of "safe" cast methods.
>
> Raffaello Giulietti has updated the pull request with a new target base due
> to a merge or a rebase. The incremental webrev excludes the unrelated changes
> brought in by the merge/rebase.
> Add a family of "safe" cast methods.
Raffaello Giulietti has updated the pull request with a new target base due to
a merge or a rebase. The incremental webrev excludes the unrelated changes
brought in by the merge/rebase. The pull request contains four additional
commits since the last revis
On Thu, 5 May 2022 15:07:32 GMT, Michael Hixson wrote:
> Rationale: It loses information. It truncates the sign, so the value can't be
> round-tripped. I think it would be the only lossy transformation permitted by
> the to*Exact methods?
Right.
-
PR: https://git.openjdk.java.net
On Thu, 5 May 2022 14:32:36 GMT, Raffaello Giulietti
wrote:
> So, what is the use case or the rationale for throwing on -0.0?
Rationale: It loses information. It truncates the sign, so the value can't be
round-tripped. I think it would be the only lossy transformation permitted by
the `to*E
On Thu, 5 May 2022 10:11:05 GMT, Raffaello Giulietti
wrote:
> Add a family of "safe" cast methods.
The JLS specifies that the cast (officially, "narrowing primitive conversion")
(long)-0.0 returns 0L.
As these methods are meant to be safer casts, I think we should follow the JLS
as closely as
On Thu, 5 May 2022 10:11:05 GMT, Raffaello Giulietti
wrote:
> Add a family of "safe" cast methods.
This PR also solves
[JDK-8154433](https://bugs.openjdk.java.net/browse/JDK-8154433), though you
went the other way on -0.0.
-
PR: https://git.openjdk.java.net/jdk/pull/8548
On Thu, 5 May 2022 10:11:05 GMT, Raffaello Giulietti
wrote:
> Add a family of "safe" cast methods.
For an in-depth rationale, please refer to the issue (Enhancement).
Note that the method names are, in fact, of the to*Exact rather than of the
as*Exact form
-
PR: https://git.openj
Add a family of "safe" cast methods.
-
Commit messages:
- 8279986: methods Math::asXExact for safely checked primitive casts
- 8279986: methods Math::asXExact for safely checked primitive casts
- 8279986: methods Math::asXExact for safely checked primitive casts
Changes: https://g
21 matches
Mail list logo