Skip to content
This repository was archived by the owner on May 4, 2019. It is now read-only.
This repository was archived by the owner on May 4, 2019. It is now read-only.

Arithmetic operators on Nullable #111

Closed
@bkamins

Description

@bkamins

The line:
https://github.com/JuliaStats/NullableArrays.jl/blob/master/src/operators.jl#L37
has the following consequences:

a) types that are not bits throw error when operated on:

x = Nullable(1)
x+x # works
x = Nullable(BigInt(1))
x+x # error

This probably should be fixed.

b) operation on a missing of type that is not bits fails

x = Nullable(1.0)
y = Nullable()
x+y # error
x+convert(Nullable{Int64}, y) # works as addition of Int64 and Float64 is possible

I am not sure if this should be fixed. Implementation convert for Nullable implies that missing value of Nullable{T} can be always converted to Nullable{S} independent on what T and S are but I am not sure if this conversion should be automatically performed in operations on nullables.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions