I am exploring PicoLisp again after several years. The idea of PicoLisp is so very appealing. It is getting my reality to fit in its idea.

I have revisited my original problem from this thread.

https://www.mail-archive.com/picolisp@software-lab.de/msg07561.html


At that time I still could not get the PicoLisp version to numbers to be equivalent with all other platforms I tested.

..

(de loop1calc (I J N)
   (let V (*/ N (+ I N) (- J N) 0.1234567 `(* 1.0 1.0 1.0))
      (normalize (*/ V V V `(* 1.0 1.0)) ) ) )

(de loop2calc (I J N)
   (normalize
      (*/ N
         (+ J 1.0)
         (+ N N N)
         0.1234567
         `(* 1.0 1.0 1.0) ) ) )

..


When I reverse the names of these functions. What is normally loop2calc produces the same results as the other implementations. So it is what is the loop1calc function that is bringing the difference.

So I began to add print statements to the loop to discover the values.

(if (= I 1.0) ... )


I have (scl 17) in my current file.

I wanted to see what was at the end of the looping and I did (if (= I 100.0) ... ) to get the last loop and printed nothing. However when I did (if (> I 99.0) ... ) it printed some values for loop 100.0.

So I began to play in the repl to try understand some things.


: (== 1.0 1.0)
-> T
: (== 10.0 10.0)
-> T
: (== 100.0 100.0)
-> T
: (scl 5)
-> 5
: (== 1.0 1.0)
-> T
: (== 10.0 10.0)
-> T
: (== 100.0 100.0)
-> T
: (scl 9)
-> 9
: (== 1.0 1.0)
-> T
: (== 10.0 10.0)
-> T
: (== 100.0 100.0)
-> T
: (scl 17)
-> 17
: (== 1.0 1.0)
-> T
: (== 10.0 10.0)
-> T
: (== 100.0 100.0)
-> NIL
:


What am I not understanding? Or am I just gifted at finding edge cases. :)

Thanks for any help.

Jimmie

Reply via email to