chansey97
2022-3-22 09:55:50

Why 4.0 is a integer? (integer? 4.0) #t (inexact? 4.0) #t


chansey97
2022-3-22 09:56:37

integer? can be inexact?


chansey97
2022-3-22 09:59:43

Oh… I just searched R5RS spec, it says: > If x is an inexact real number, then (integer? x) is true if and only if (= x (round x)). counter-intuitively


chansey97
2022-3-22 10:00:35

> Note: The behavior of these type predicates on inexact numbers is unreliable, since any inaccuracy may affect the result. …


soegaard2
2022-3-22 10:52:47

In math 4.0 and 4 is the same number, since (4.0 means 4*1+0*1/10). In that sense integer? is spot on. There is an exact-integer? in Racket, if you want to avoid floating point.


chansey97
2022-3-22 11:31:43

exact-integer? is what I want. Thanks.


bsilverstrim
2022-3-22 21:08:19

Has anyone mentioned if there’s work or support being considered for the raspi pico?