Skip to content

prod for tuples uses * #39183

Closed
Closed
@yurivish

Description

@yurivish
julia> prod([Int8(100), Int8(100)])
10000

julia> prod((Int8(100), Int8(100)))
16

julia> versioninfo()
Julia Version 1.5.3
Commit 788b2c77c1 (2020-11-09 13:37 UTC)
Platform Info:
  OS: macOS (x86_64-apple-darwin18.7.0)
  CPU: Intel(R) Core(TM) i9-9980HK CPU @ 2.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)

Ref. #39182, which is the same issue but for sum and +

The is a todo in the code that says this function definition is inconsistent with regular prod:

julia/base/tuple.jl

Lines 399 to 400 in 788b2c7

# TODO: this is inconsistent with the regular prod in cases where the arguments
# require size promotion to system size.

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugIndicates an unexpected problem or unintended behaviormathsMathematical functionsstdlibJulia's standard library

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions