Bug introduced in 9.0 and fixed in 10.3
I have a list of 10 000 3×3 matrices in Mathematica. The entries are rational numbers. I would like to write this to a file so I can load it again in the future. After some fussing with file formats, it looks like the one I'd like to use is "WDX". However, some of my numbers are quite large, and don't seem to want to export. Does anyone know a good way around this issue?
I can reproduce the sort of problem I'm having just by running:
Export[NotebookDirectory[] <> "junk.wdx", {42838805520130}, "WDX"]
which returns
BinaryWrite::nocoerce: 42838805520130 cannot be coerced to the specified format. >>
I've used the "MX" file format, which works well, but I want to be able to import the file on another computer. Other file types don't seem to work so well. (For example, the "Table" format bizarrely introduces extraneous commas.)
ExportString[(2^31)^x, "WDX"]
works, butExportString[(2^31)^1, "WDX"]
doesn't. It seems that as long as it is part of an expression it's OK, but when it's used as a pure number, or a list of numbers it fails.ExportString[List[2^31], "WDX"]
fails, butExportString[List2[2^31], "WDX"]
works. Looks like a bug to me. $\endgroup$Save
. $\endgroup$Export["file.mz", Compress[expression], "String"]
$\endgroup$