Skip to content

halleysfifthinc/VaxData.jl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

54 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

VaxData

version pkgeval CI codecov.io Project Status: Active – The project has reached a stable, usable state and is being actively developed.

VaxData.jl is a direct port to Julia from libvaxdata 1. See this report for an in-depth review of the underlying structure and differences between VAX data types and IEEE types.

There are 5 Vax datatypes implemented by this package: VaxInt16, VaxInt32, VaxFloatF, VaxFloatG, and VaxFloatD.

Examples

julia> one(VaxFloatF)
vaxf"1.0"

julia> -one(VaxFloatF)
vaxf"-1.0"

julia> vaxg"3.14159265358979323846264338327950"
vaxg"3.1415926535897931"

julia> vaxd"3.14159265358979323846264338327950"
vaxd"3.14159265358979323"

Conversion to and from each type is defined; Vax types are promoted to the next appropriately sized type supporting math operations:

promote_type(VaxFloatF, Float32)
Float32

promote_type(VaxFloatF, VaxFloatF)
Float32

promote_type(VaxFloatF, Float64)
Float64

Footnotes

  1. Baker, L.M., 2005, libvaxdata: VAX Data Format Conversion Routines: U.S. Geological Survey Open-File Report 2005-1424 (http://pubs.usgs.gov/of/2005/1424/).