# Where do I add a rationalize() function?

**URL:** <https://discourse.julialang.org/t/where-do-i-add-a-rationalize-function/72823>\
**Category:** General Usage\
**Created:** [December 9, 2021, 1:03pm UTC](https://discourse.julialang.org/t/where-do-i-add-a-rationalize-function/72823 "2021-12-09T13:03:56Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![ayushsengupta8](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ayushsengupta8/32/31757_2.png) [@ayushsengupta8](https://discourse.julialang.org/u/ayushsengupta8)\
**Post date:** [December 9, 2021, 1:03pm UTC](https://discourse.julialang.org/t/where-do-i-add-a-rationalize-function/72823/1 "2021-12-09T13:03:56Z")

</div>

Can anyone provide me the exact file name in GitHub (also the folder which it is in) so that I can add a rationalize function in the code.  
P.S I am completely new to opensource that’s why I am not sure about this topic. Would be great if anyone helps! Good Day!

---

<div class="post-metadata">

**Author:** ![fgerick](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/fgerick/32/13228_2.png) [@fgerick](https://discourse.julialang.org/u/fgerick)\
**Post date:** [December 9, 2021, 1:14pm UTC](https://discourse.julialang.org/t/where-do-i-add-a-rationalize-function/72823/2 "2021-12-09T13:14:03Z")

</div>

Hi @ayushsengupta8 ,  
it’s not completely clear what you mean by the rationalize function and where you would like to add it. There’s already a [rationalize](https://github.com/JuliaLang/julia/blob/3bf9d1773144bc4943232dc2ffaac307a700853d/base/rational.jl#L157) function in Julia `Base`, which does e.g. this:

```julia
julia> rationalize(0.2)
1//5

```

---

<div class="post-metadata">

**Author:** ![ayushsengupta8](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/ayushsengupta8/32/31757_2.png) [@ayushsengupta8](https://discourse.julialang.org/u/ayushsengupta8)\
**Post date:** [December 9, 2021, 5:47pm UTC](https://discourse.julialang.org/t/where-do-i-add-a-rationalize-function/72823/3 "2021-12-09T17:47:43Z")

</div>

Thanks for the reply! It has answered my doubt

---

<div class="post-metadata">

**Author:** ![goerch](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/goerch/32/29122_2.png) [@goerch](https://discourse.julialang.org/u/goerch)\
**Post date:** [December 9, 2021, 8:02pm UTC](https://discourse.julialang.org/t/where-do-i-add-a-rationalize-function/72823/4 "2021-12-09T20:02:16Z")

</div>

Please mark as resolved. Thanks!
