-
Notifications
You must be signed in to change notification settings - Fork 19
Open
Description
Serialization of the type Irrational{S} is missing. For example:
julia> pack(pi)
ERROR: no non-`AnyType` MsgPack mapping found for Irrational{:π}; please overload `msgpack_type` for this type.I think most users are not aware that pi is not simply the floating point representation of pi, therefore expecting that if you can pack a float, you can also pack pi.
I would propose to add the following to the package:
MsgPack.msgpack_type(::Type{Irrational{S}}) where S = MsgPack.FloatType()
MsgPack.to_msgpack(::MsgPack.FloatType, x::Irrational{S}) where S = float(x)I could prepare a PR, if you find this useful.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels