# CSV.read with really small decimal value

**URL:** <https://discourse.julialang.org/t/csv-read-with-really-small-decimal-value/14274>\
**Category:** Data\
**Created:** [August 29, 2018, 9:46pm UTC](https://discourse.julialang.org/t/csv-read-with-really-small-decimal-value/14274 "2018-08-29T21:46:00Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![youngjae.woo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/youngjae.woo/32/4750_2.png) [@youngjae.woo](https://discourse.julialang.org/u/youngjae.woo)\
**Post date:** [August 29, 2018, 9:46pm UTC](https://discourse.julialang.org/t/csv-read-with-really-small-decimal-value/14274/1 "2018-08-29T21:46:00Z")

</div>

CSV.read runs into the following error if there is a value below 5e-324.

```julia
ERROR: MethodError: no method matching /(::Base.TwicePrecision{Float64}, ::Base.TwicePrecision{Float64})
Closest candidates are:
  /(::Base.TwicePrecision, ::Number) at twiceprecision.jl:495
  /(::DataValues.DataValue{T1}, ::T2) where {T1, T2} at /Users/youngjaewoo/.julia/v0.6/DataValues/src/scalar/operations.jl:55
  /(::T1, ::DataValues.DataValue{T2}) where {T1, T2} at /Users/youngjaewoo/.julia/v0.6/DataValues/src/scalar/operations.jl:65

```

One hack is to read the numeric column as String and then parse them manually which converts numbers below 5e-324 into 0s. This is true in Julia 0.6.4.

How can this be done better? Any idea?

---

<div class="post-metadata">

**Author:** ![quinnj](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/quinnj/32/11_2.png) [@quinnj](https://discourse.julialang.org/u/quinnj)\
**Post date:** [August 29, 2018, 9:53pm UTC](https://discourse.julialang.org/t/csv-read-with-really-small-decimal-value/14274/2 "2018-08-29T21:53:23Z")

</div>

Upgrade to 0.7/1.0! This is fixed in the current release of CSV.

---

<div class="post-metadata">

**Author:** ![youngjae.woo](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/youngjae.woo/32/4750_2.png) [@youngjae.woo](https://discourse.julialang.org/u/youngjae.woo)\
**Post date:** [August 29, 2018, 10:08pm UTC](https://discourse.julialang.org/t/csv-read-with-really-small-decimal-value/14274/3 "2018-08-29T22:08:40Z")

</div>

Thanks! I just tested with Julia 0.7 yet it now mis-represents the scientific notation.

For instance, 4.12e-551 gets imported as 4.12e-243

I think this is a problem for those who use these small values.

![29%20AM](https://global.discourse-cdn.com/julialang/original/3X/d/7/d750373bb2e18831db753e003da348884bf29fc9.png)

---

<div class="post-metadata">

**Author:** ![davidanthoff](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/davidanthoff/32/223493_2.png) [@davidanthoff](https://discourse.julialang.org/u/davidanthoff)\
**Post date:** [September 3, 2018, 10:49pm UTC](https://discourse.julialang.org/t/csv-read-with-really-small-decimal-value/14274/4 "2018-09-03T22:49:21Z")

</div>

You can try [CSVFiles.jl](https://github.com/queryverse/CSVFiles.jl), it uses a different implementation.
