help-gnu-emacs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: What is 0.01 here not 0.01 here 0.009999999999999?


From: Stefan Monnier
Subject: Re: What is 0.01 here not 0.01 here 0.009999999999999?
Date: Fri, 02 Apr 2021 09:56:00 -0400
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux)

> I would like to get a number increased for 0.01:

Are you aware that in most programming languages (including ELisp) there
is no floating point number whose value is exactly 0.01?

If not, I suggest you either avoid floating point numbers, accept that
floating point numbers always are inexact, or read up on floating point
numbers (e.g. https://en.wikipedia.org/wiki/Floating-point_arithmetic)


        Stefan




reply via email to

[Prev in Thread] Current Thread [Next in Thread]