You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 1793f4b
Browse filesBrowse the repository at this point in the historyBrowse files
compiler: Print an Array initializer through the ordinary printer path
An Array initializer already reached the printer, via `ccode` on a
`ListInitializer`; what it did not do was reach it at the Array's own
precision. The elements were printed with the Operator's settings, so a
narrow Array sitting in an Operator whose arithmetic is left at the
default width had its entries emitted at the wider type.
Pass the Array's dtype to `ccode`, as `Expression` already does, rather
than route the initializer around the printer through an `initvalue`
hook of its own. A target that needs to spell its literals differently
overrides `_print_ListInitializer`, which is the ordinary extension
point.
With the precision now correct at the point of printing, `_prec` no
longer needs to be told whether the arithmetic was narrowed on purpose:
a real literal takes the precision it is being printed at, and the
`float32` floor applies only where that is not itself a float. That is
the same value as before for every dtype other than `float16`.
0 commit comments