# The thread of the errors in the docs

**URL:** <https://discourse.ats-lang.org/t/the-thread-of-the-errors-in-the-docs/17>\
**Category:** Google Group\
**Created:** [January 28, 2015, 5:49pm UTC](https://discourse.ats-lang.org/t/the-thread-of-the-errors-in-the-docs/17 "2015-01-28T17:49:32Z")\
**Posts on this page:** 4\
**Page:** 2

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [February 1, 2015, 3:37pm UTC](https://discourse.ats-lang.org/t/the-thread-of-the-errors-in-the-docs/17/21 "2015-02-01T15:37:30Z")

</div>

The polynomial should be lam x =\> x \* x - x - 110. Fixed.On Sun, Feb 1, 2015 at 7:17 AM, ‘Yannick Duchêne’ via ats-lang-users \< [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com)\> wrote:

> Unless I’ve missed something, there is one in  
> [http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/x794.html](http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/x794.html)
> 
> It says “For instance, calling rtfind on the polynomial function lam x =\>  
> x \* x - x + 110 returns 11”. But x² - x + 110 = 0 has no solution in ℝ.  
> Testing the example returns the erroneous result 463410 on my 32 bits  
> machine.
> 
> Le mercredi 28 janvier 2015 18:49:32 UTC+1, Yannick Duchêne a écrit :
> 
> > I don’t remember of any already existing one, so I’m opening this thread  
> > where to report any errors in the docs, instead of opening a new thread for  
> > each possible eventual errors (saying that, I don’t want to mean there are  
> > many).
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/92d37708-5bbb-4640-ad1f-354e75802fb5%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/92d37708-5bbb-4640-ad1f-354e75802fb5%40googlegroups.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/92d37708-5bbb-4640-ad1f-354e75802fb5%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/92d37708-5bbb-4640-ad1f-354e75802fb5%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [February 6, 2015, 5:31pm UTC](https://discourse.ats-lang.org/t/the-thread-of-the-errors-in-the-docs/17/22 "2015-02-06T17:31:03Z")

</div>

Just want to add that using ndiv (division for natural numbers) also works.  
You can write

ndiv(diff, 2)

or

(diff \ndiv 2)On Fri, Feb 6, 2015 at 12:26 PM, Hongwei Xi [gmh...@gmail.com](mailto:gmh...@gmail.com) wrote:

> Thanks for pointing it out.
> 
> I have changed (diff / 2) into half(diff). The type assigned to integer  
> division in ATS2  
> is no longer strong enough for this example.
> 
> On Fri, Feb 6, 2015 at 12:07 PM, ‘Yannick Duchêne’ via ats-lang-users \< [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com)\> wrote:
> 
> > In [http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/x2528.html](http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/x2528.html)  
> > , about the second definition of the `isqrt` function, this sentence looks  
> > strange to me: “The following code we obtain after proper modification does  
> > pass typechecking”. Actually, it does not: both `patscc --typecheck` and  
> > `patscc -tcats` tells about one unsolved constraint error and two unsolved  
> > termination constraints errors.
> > 
> > Le mercredi 28 janvier 2015 18:49:32 UTC+1, Yannick Duchêne a écrit :
> > 
> > > I don’t remember of any already existing one, so I’m opening this thread  
> > > where to report any errors in the docs, instead of opening a new thread for  
> > > each possible eventual errors (saying that, I don’t want to mean there are  
> > > many).
> > > 
> > > –  
> > > You received this message because you are subscribed to the Google Groups  
> > > “ats-lang-users” group.  
> > > To unsubscribe from this group and stop receiving emails from it, send an  
> > > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > > To view this discussion on the web visit  
> > > [https://groups.google.com/d/msgid/ats-lang-users/94b73663-3d66-4a5d-9da5-3764d6bd1391%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/94b73663-3d66-4a5d-9da5-3764d6bd1391%40googlegroups.com)  
> > > [https://groups.google.com/d/msgid/ats-lang-users/94b73663-3d66-4a5d-9da5-3764d6bd1391%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/94b73663-3d66-4a5d-9da5-3764d6bd1391%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > > .

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [May 20, 2015, 5:21am UTC](https://discourse.ats-lang.org/t/the-thread-of-the-errors-in-the-docs/17/23 "2015-05-20T05:21:56Z")

</div>

Fixed. Thanks!On Wed, May 20, 2015 at 1:08 AM, ‘Yannick Duchêne’ via ats-lang-users \< [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com)\> wrote:

> Le mercredi 28 janvier 2015 18:49:32 UTC+1, Yannick Duchêne a écrit :
> 
> > I don’t remember of any already existing one, so I’m opening this thread  
> > where to report any errors in the docs, instead of opening a new thread for  
> > each possible eventual errors (saying that, I don’t want to mean there are  
> > many).
> > 
> > […]
> 
> Unless I’ve missed something, I believe there is a repeated error in  
> [http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/c642.html](http://ats-lang.sourceforge.net/DOCUMENT/ATS2TUTORIAL/HTML/HTMLTOC/c642.html)  
> : `n` is never decremented.
> 
> At least, adding a termination metric, without touching the function’s  
> logic, makes ATS catch an error:  
> fun fact  
> {n: int} (n: int n): int = let  
> fun loop {n: int} .. (n: int n, res: int): int =  
> if n \> 0 then loop (n, n \* res) else res  
> // end of [loop]  
> in  
> loop (n, 1)  
> end // end of [fact]
> 
> This one is OK:  
> fun fact  
> {n: nat} (n: int n): int = let  
> fun loop {n: nat} .. (n: int n, res: int): int =  
> if n \> 0 then loop (n - 1, n \* res) else res  
> // end of [loop]  
> in  
> loop (n, 1)  
> end // end of [fact]
> 
> This seems to be the same with the two preceding functions.
> 
> –  
> You received this message because you are subscribed to the Google Groups  
> “ats-lang-users” group.  
> To unsubscribe from this group and stop receiving emails from it, send an  
> email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> To view this discussion on the web visit  
> [https://groups.google.com/d/msgid/ats-lang-users/dc10bab4-ad2f-4f28-819f-9a87f478b074%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/dc10bab4-ad2f-4f28-819f-9a87f478b074%40googlegroups.com)  
> [https://groups.google.com/d/msgid/ats-lang-users/dc10bab4-ad2f-4f28-819f-9a87f478b074%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/dc10bab4-ad2f-4f28-819f-9a87f478b074%40googlegroups.com?utm_medium=email&utm_source=footer)  
> .

---

<div class="post-metadata">

**Author:** ![gmhwxi](https://avatars.discourse-cdn.com/v4/letter/g/67e7ee/32.png) [@gmhwxi](https://discourse.ats-lang.org/u/gmhwxi)\
**Post date:** [February 7, 2015, 2:40pm UTC](https://discourse.ats-lang.org/t/the-thread-of-the-errors-in-the-docs/17/24 "2015-02-07T14:40:59Z")

</div>

Fixed. Thanks!On Sat, Feb 7, 2015 at 7:27 AM, ‘Yannick Duchêne’ via ats-lang-users \< [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com)\> wrote:

> A tiny thing, a typo here:  
> [http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/c2843.html](http://ats-lang.sourceforge.net/DOCUMENT/INT2PROGINATS/HTML/c2843.html)
> 
> “Within the ATS programming _langauge_ system” (should be “language”)
> 
> Le mercredi 28 janvier 2015 18:49:32 UTC+1, Yannick Duchêne a écrit :
> 
> > I don’t remember of any already existing one, so I’m opening this thread  
> > where to report any errors in the docs, instead of opening a new thread for  
> > each possible eventual errors (saying that, I don’t want to mean there are  
> > many).
> > 
> > –  
> > You received this message because you are subscribed to the Google Groups  
> > “ats-lang-users” group.  
> > To unsubscribe from this group and stop receiving emails from it, send an  
> > email to [ats-lang-user...@googlegroups.com](mailto:ats-lang-user...@googlegroups.com).  
> > To post to this group, send email to [ats-lan...@googlegroups.com](mailto:ats-lan...@googlegroups.com).  
> > Visit this group at [http://groups.google.com/group/ats-lang-users](http://groups.google.com/group/ats-lang-users).  
> > To view this discussion on the web visit  
> > [https://groups.google.com/d/msgid/ats-lang-users/f3dc8364-8b56-4646-b23e-37f5b5bb1f77%40googlegroups.com](https://groups.google.com/d/msgid/ats-lang-users/f3dc8364-8b56-4646-b23e-37f5b5bb1f77%40googlegroups.com)  
> > [https://groups.google.com/d/msgid/ats-lang-users/f3dc8364-8b56-4646-b23e-37f5b5bb1f77%40googlegroups.com?utm\_medium=email&utm\_source=footer](https://groups.google.com/d/msgid/ats-lang-users/f3dc8364-8b56-4646-b23e-37f5b5bb1f77%40googlegroups.com?utm_medium=email&utm_source=footer)  
> > .

[Previous page](https://discourse.ats-lang.org/t/the-thread-of-the-errors-in-the-docs/17.md?page=1)
