Julia: Unsafe literal constants with powers (e.g. 10藛10 in 32 bit systems)

Created on 14 Aug 2019  路  14Comments  路  Source: JuliaLang/julia

Most helpful comment

I'm not sure it's worth our time to try and generify this, although perhaps it is!

It's not.

All 14 comments

For reference, I looked for examples for example in

grep -r --include="*.jl" [^\.][0-9]\^[0-9] . | less

... and I did this to convince you to reopen #5573 ;-) This problem permeates the entire ecosystem, https://pkg.julialang.org/docs/search?q=2%5C%5E%5B3-9%5D%5B0-9%5D%7C%5B%5E%5C.%5D%5B0-9%5D%7B2,%7D%5C%5E%5B0-9%5D%7B2,%7D

As a somewhat broader point, maybe we should run doctests on both a 64- and 32-bit platform?

Also, what would you like the behavior here to be?

As a somewhat broader point, maybe we should run doctests on both a 64- and 32-bit platform?

A somewhat minimal requirement is to make passing 32-bit doctests mandatory for the release candidates?

@staticfloat, could we just add an extra CI build for 32-bit doctests?

Also, what would you like the behavior here to be?

I think I would like ^ with literal arguments use a checked version of power_by_squaring (which would make sense if there is no performance penalty due to constant propagation), but I cannot say if this realistic.

Lots of things print differently on 32bit so running the doctests there are not that easy.

Even though the proximate issue is dealt with perhaps I should leave this open for a bit more discussion of the general problem.

There are a very large number of doctest errors when run on a 32bit machine, because many of the outputs expect e.g. ::Array{Int64,1}, when they instead get ::Array{Int32,1}. I'm not sure it's worth our time to try and generify this, although perhaps it is! I can create a doctest_linux32 builder trivially; but it will just add to the noise unless we go through and change a large proportion of the current docstrings.

I'm not sure it's worth our time to try and generify this, although perhaps it is!

It's not.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

musm picture musm  路  3Comments

Keno picture Keno  路  3Comments

omus picture omus  路  3Comments

omus picture omus  路  3Comments

tkoolen picture tkoolen  路  3Comments