On Mon, 8 Jun 2026 09:09:16 GMT, Jatin Bhateja <[email protected]> wrote:

>> Is `Float16Vector::toString` supposed to return short values in the list? Or 
>> should they be formatted as floats?
>
>> Is `Float16Vector::toString` supposed to return short values in the list? Or 
>> should they be formatted as floats?
> 
> jshell> import jdk.incubator.vector.*
> jshell> Float16Vector.broadcast(Float16Vector.SPECIES_512, 
> Float.floatToFloat16(1.2f))
> $4 ==> [15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565, 
> 15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565, 
> 15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565, 15565]
> 
> 
> We print the short values from backing storage which encodes IEEE 754 
> binary16 values.

@jatin-bhateja @PaulSandoz I suppose it is consistent: `toString`, `toArray` 
etc all produce `short[]` style results. It's not very nice to read when you 
see it first, but I suppose one can always do the conversion to float manually.

-------------

PR Comment: https://git.openjdk.org/jdk/pull/28002#issuecomment-4647231384

Reply via email to