Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion src/serialize/primitive.rs
Original file line number Diff line number Diff line change
Expand Up @@ -288,7 +288,7 @@ macro_rules! impl_complex_serializable {
/// _This impl is only available with the **`"complex"`** feature._
impl AutoSerialize for Complex<$float> {
fn default_dtype() -> DType {
DType::new_scalar(TypeStr::with_auto_endianness(TypeChar::Complex, $size, None))
DType::new_scalar(TypeStr::with_auto_endianness(TypeChar::Complex, 2 * $size, None))
}
}
)+};
Expand Down Expand Up @@ -498,4 +498,11 @@ mod tests {
assert_eq!(u32::default_dtype().descr(), "'<u4'");
}
}

#[test]
#[cfg(feature = "complex")]
fn default_complex_type_strs() {
assert_eq!(Complex::<f32>::default_dtype().descr(), "'<c8'");
assert_eq!(Complex::<f64>::default_dtype().descr(), "'<c16'");
}
}
Loading