Re: Nim's float issue?

2020-02-28 Thread Stefan_Salewski
> it's a serious question, Maybe. I hoped he would come back so that we would know for sure, but he did not. Well sometimes my answers may be wrong or bad, so it may be better to do not answer at all and leave answers to the paid Nim devs, or at least native english speakers. In am none of

Re: Nim's float issue?

2020-02-26 Thread timothee
@Stefan_Salewski @Nam > It`s a bit hard to believe that this is a serious question because of > But maybe you missed that and have no CS experience. > That is not a Nim issue, but occurs from representation of floats in the CPU it's a serious question, no need to question about OP's CS

Re: Nim's float issue?

2020-02-25 Thread ffred60
another option when in need for accuracy and to avoid rounding problem (like in financial activities) is to use a Decimal library.. [http://net-informations.com/q/faq/float.html](http://net-informations.com/q/faq/float.html)

Re: Nim's float issue?

2020-02-25 Thread kaushalmodi
Wow! I didn't know of [https://float.exposed/](https://float.exposed/). Cool website!

Re: Nim's float issue?

2020-02-25 Thread jva
Maybe I'm wrong but I think the answer is fine, did not notice any arrogance IMHO. He just points out the docs first. It is really important to get used to docs although no one likes them. So called "CS degrees" are also very useful, you learn a ton of interesting things there.

Re: Nim's float issue?

2020-02-25 Thread demotomohiro
You can learn how float works in following web sites: [https://float.exposed](https://float.exposed)/ [https://en.wikipedia.org/wiki/IEEE_754](https://en.wikipedia.org/wiki/IEEE_754)

Re: Nim's float issue?

2020-02-25 Thread Divy
The answer is really good but please respect that everyone here is learning and some might not be from a CS background! I'm 15 and certainly not yet graduated yet I code and love Nim. I guess it would be really nice if we leave arrogance and so called "CS degrees" aside and talk Nim :)

Re: Nim's float issue?

2020-02-25 Thread juancarlospaco
`round` is Deprecated.

Re: Nim's float issue?

2020-02-25 Thread r3c
I think @adnan is right, in the round function output like 88.91 is expected, but fmt should trim it to 2 decimals.

Re: Nim's float issue?

2020-02-25 Thread kaushalmodi
Your answer was nice but I think you it was equally helpful without: > It's a bit hard to believe that this is a serious question because of.. and > But maybe you missed that and have no CS experience. I think most people would have stumbled across this in one programming language or another.

Re: Nim's float issue?

2020-02-25 Thread adnan
[https://0.30004.com](https://0.30004.com)/

Re: Nim's float issue?

2020-02-25 Thread Stefan_Salewski
It`s a bit hard to believe that this is a serious question because of [https://nim-lang.org/docs/math.html#round%2CT%2Cint](https://nim-lang.org/docs/math.html#round%2CT%2Cint) But maybe you missed that and have no CS experience. The basic fact is that we can not present each decimal number

Nim's float issue?

2020-02-25 Thread Nam
I'm following "Nim basics" tutorial and stumbled to this case when I was trying to convert in to cm: import math,strformat echo " in | cm" echo "-" for i in 1 .. 40: echo fmt"{i:3}", " | ", round(float(i) * 2.54, 1) Run